Is there a phpFiddle and sqlFiddle that work together?
Solution 1:
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.
Solution 2:
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
Solution 3:
You could connect PHP fiddle to dropbox and then use a file based database like sqlite.
Solution 4:
The PHPize.online have all demanded functionality. It's provide SQL fiddle (MySQL 5.7/8.0, MariaDB 10, PostgreSQL 11-14, SQLite 3 and MS SQL 2017/19) with PHP fiddle (5.6, 7.4, 8.0).
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).