Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a phpFiddle and sqlFiddle that work together?

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?

like image 754
Craig Avatar asked Sep 12 '12 23:09

Craig


3 Answers

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.

like image 112
Jake Feasel Avatar answered Oct 11 '22 01:10

Jake Feasel


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

like image 3
fedmich Avatar answered Oct 11 '22 00:10

fedmich


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

like image 3
Relequestual Avatar answered Oct 11 '22 01:10

Relequestual