Parsing SQL with PHP