I want to write a php function that could parse select SQL queries.
Just for an example:
select * from tableA a, tableB b
where a.cola = b.colb
and cola = 'abcd'
to convert into:
select * from tableA a where a.cola = 'abcd'
select * from tableB b where b.colb = 'abcd'
It should also work on inner joins.
Any help regarding the approach / algorithm or Code would help??
*I am using http://code.google.com/p/php-sql-parser/ to perform this.
UPDATE: What I am really looking for is to make sure that we had all the data, but not a lot of extra data was to split each query into a single table select, and covert that select into an insert. That would insure that the original query could run, and have all the data it needs. I need to make sure all data is in the correct tables to recreate that page execution with a new database.
php-sql-parser
– Ø Hanky Panky Ø Mar 28 at 5:13