Hi,

Some of you might remember me posting a script a while ago, called PHP Dump, it is basically an enhanced version of var_dump, anyway, more can be found about that here.

I have just added a new feature to PHP Dump, which is the ability to code highlight and format SQL queries (the query string not the result) so that they are easily read. This is epically useful if you have scripts that generate dynamic queries, or if you just have a really long query that you want to inspect.

I must stress that this is only in a test stage at the moment. As far as I am aware there are no bugs, but it does lack A LOT of support for all the different clauses, functions etc. that a query string may contain. If anyone can help me complete the list of supported clauses etc. please let me know. Also, if you have any problems with the script, or come across a query that doesn’t seem to output correctly (and is valid SQL) please let me know.

Below are two example queries and i have attached an image of their output when passed through PHP Dump (i know that these arnt actually valid SQL, but they do demonstrate the functionality of the script quite well).

Let me know what you think, cheers! :-)
Link to script: PHP Dump.

SELECT id, title, content, datePosted, status, MAX(comments) AS maxComments FROM blog WHERE status = 1 AND comments > 5 ORDER BY datePosted DESC LIMIT 0, 5

INSERT INTO blog (title, content, status) VALUES ('Test Article', 'Test test test test test', 1)
    Write a Reply...