This lib can make the SQL look better, and format the SQL into HTML code
Actually,it's just wrapped around libraries of phpmyadmin
Demo
Download
Screenshot
Project on Google Code
<link rel="stylesheet" href="sqlparserlib/sqlsyntax.css" /><?php define("PARSER_LIB_ROOT", "/home/admin/www/sqlparserlib/"); require_once PARSER_LIB_ROOT."sqlparser.lib.php"; function SQLFormatPHP($sql){ return PMA_SQP_formatHtml(PMA_SQP_parse($sql)); } $sql = "SELECT * FROM (select * from dual)"; echo SQLFormatPHP($sql);?>