php script sql query parser sql2tree
http://www.phpclasses.org/browse/package/4916.html
Build a tree to represent an SQL query !
Video of a php class that can be used to build a tree to represent an SQL query.
It takes a given SQL query and parse it to extract the structure or queries and sub-queries. The resulting structure is returned as an array.
Currently it supports only SELECT, INSERT, [...]