Is there a phpFiddle and sqlFiddle that work together?
Asked Answered
I

6

24

Is there an online phpFiddle and sqlFiddle that work together so that I can do something with the test sql data?

Using http://phpfiddle.org/ and http://sqlfiddle.com/ but would be great if they could work together.

I'm sure someone out there has created an all-in-one SQL, PHP and JS fiddle. No?

Idona answered 12/9, 2012 at 23:39 Comment(7)
XAMPP /localhost ?Enure
Yes I have my own server, just though it would be nice to be able to quickly make changes and play around without having to upload every couple of secs and modify the database.Idona
From phpfiddle create mysql temporary tables and query them, although you would need to open a connection to some mysql server, but could be an account setup by phpfiddle crew with no tables, or you could connect your mysql server remotely. Temporary tables disappear once the connection is closed.Hardtop
I've thought about what it would take to bring SQL fiddle to other backends (rubyfiddle? codecademy? etc...). Haven't figured it out quite yet, though.Weaponless
Yes I think it would be great to have a project site that is a bunch of "fiddles" that work together. Would make collaboration very easy and would allow people without the tools to just jump in and start programming. Also great if you are away and can just jump on a computer with Internet access and continue working. Then once you have a working product then move it to your own server etc.Idona
strange that still there is no such fiddles after 4 years.....Intracutaneous
Of course, nowadays, phpfiddle.org covers this. It's a great way to share with others (unlike localhost), and is widely used on this siteAndriaandriana
W
13

Okay, so this isn't exactly what you asked for, but it's close.

http://jsfiddle.net/S3DR9/

Here you can see a JS Fiddle that is successfully calling out to SQL Fiddle with AJAX (now possible as a result to my apache config to allow this to go through). All you have to have is a SQL Fiddle hash fragment (everything after the #; for example this SQL Fiddle link http://sqlfiddle.com/#!2/a2581/1 has the has fragment of !2/a2581/1) and you can see how I pass that into the URL to get back the JSON response. The rest of the code in that JS Fiddle link is just parts I've taken from my main codebase, simplified as needed. I would imagine this is enough to see the basics, as far as how to put it together.

Now, it would be a whole 'nother exercise to try to wrap up such a call to SQL Fiddle in a PHP library of some sort that attempted to emulate an actual database driver. I would think that would be the sort of thing you'd want to do in a php sandbox, so you could simulate an actual db call. If someone is interested in building that out, let me know.

Weaponless answered 13/9, 2012 at 0:44 Comment(3)
is there anything going on with Sqlfiddle right now? Doesn't seem to work mate :$ thanksSaber
Just PM'd him about this - www.sqlfiddle.com still works (guessing it's borked apache config)Curitiba
Thanks guys! It's back now.Weaponless
K
4

The PHPize.online have all demanded functionality. It's provide SQL fiddle (MySQL 5.7/8.0, MariaDB 10, PostgreSQL 11-15, SQLite 3 and MS SQL 2017/19/22, Oracle 19/21/23 and SoQoL) with PHP fiddle (5.6, 7.4, 8.0, 8.1, 8.2).

PHPize.online is a free online environment for quickly running, experimenting with and sharing PHP and SQL code. You can run your SQL code on top of most popular RDBMS, and run PHP code that can use the same DB. For database usage you can use pre-defined instanses of PDO ($pdo) & mysqli ($mysqli).

Kiddy answered 18/11, 2020 at 20:32 Comment(0)
A
3

At the time of writing this, I think there is no combined (php/db) fiddle tools like that. Would be quite useful to have this online tool alright.

I think the best you can do at the moment is to just have your portable server, Apache, Mysql db or you can use XAMPP portable. Something that you can run in your USB.

There are benefits on having a portable version, instead of online fiddles.

  • you could run codes faster, no need to wait for the outputs online
  • even if you have slow net, or no internet you can still code.
  • You can code in your favorite IDE
  • hmm, what else guys?

then you can also integrate it into dropbox, if you are after the online sharing of urls

Ahwaz answered 21/9, 2012 at 3:0 Comment(1)
You can also create batch files to start/stop the apache and mysql services if you want. I think Xampp portable have this already in there.Ahwaz
H
3

You could connect PHP fiddle to dropbox and then use a file based database like sqlite.

Hermineherminia answered 23/11, 2012 at 17:0 Comment(0)
C
0

Yes - Glitch

A service to help demo code called Glitch helped me demo a NodeJS answer on Stack Overflow along with PHP/SQLite and JS files for a PHP answer. It works with recent editors and is built off of variety of Server flavors such as NodeJS or PHP. Application demos use SlimPHP framework for the PHP projects. You can add edit files and publish output online as well as share live results with code.

Searching on glitch for a sample SlimPHP, SQLite demo returned this project that you can fork from.

https://glitch.com/~notarazi-slim-php-sqlite

Cutback answered 8/11, 2020 at 19:28 Comment(0)
C
-1

I'm a knob, a neophyte, a hack that messes with code to see if I can get it to work (i.e. I'm not a "developer").

I use Wordpress, with a Code Manager plugin to create the environment with my hosting company. I have Code manager open in one tab to fiddle, another tab displays a page with the needed shortcode from Code Manager to view results.

I use available fiddles to test parts of the code (JSFiddle, PHP sandbox, SQL Fiddle) and then put them together in the Wordpress environment.

Kinda convoluted but gets the job done.

Cenac answered 11/1, 2022 at 10:0 Comment(6)
Can somebody explain the -1 so I don't do it again? ThanksCenac
Your answer didn't answer the question, it just explained something that you do that isn't really relevant to the question.Bort
The question is: " Is there an online phpFiddle and sqlFiddle that work together so that I can do something with the test sql data? " The questioner would like to do something with the test SQL data. What I explained does exactly that. How is that not relevant to the question? Don't knock it till you've tried it.Cenac
As you said, OP is asking for an online phpFiddle and sqlFiddle that work together. OP is not asking for alternative methods so they can do something with the test SQL data. Explaining how to use wordpress to achieve the goal of doing something with the test data is not answering the question of "Is there an online phpFiddle and sqlFiddle that work together?"Bort
Read the thread. Every other answer is an alternative to what you think the op needs. Given your logic, the only acceptable answer is "no". Really, you should not comment on something you know nothing about. Unless you have tried the Wordpress alternative. Have you?Cenac
I'm just answering your comment of likely why you got the -1. I arrived here recently because I was looking for something similar to OP. I can easily build something myself, (although I personally wouldn't pick wordpress to do it) but what I want is a 3rd party service that will do it for me. If you read the thread, most of the other answers point to actual fiddle-style services that are what OP asked for, or workarounds using existing fiddles. Yours involves setting up and dealing with wordpress (which may be new to OP) & a whole bunch of stuff before you can paste sql & php and share a link.Bort

© 2022 - 2024 — McMap. All rights reserved.