What I am looking for is a php function that takes an unformatted query like this:
$sql = "select name, size from things where color = 'green' order by price asc";
so that it would appear in an HTML page something like this:
SELECT name, size FROM things WHERE color = 'green' ORDER BY price ASC';
There's some code inside phpMyAdmin that does this already, I could look in there I guess!