I need to add WHERE, SELECT, ORDER BY etc...like a chain SQL by means of PHP. I use https://github.com/greenlion/PHP-SQL-Parser to spilt up the SQL in Array and then to form the SQL
i need a intermediate code. i can to add SELECT,WHERE, ORDER BY, ETC.. and i can test if exist in the table, fields, in array of PHPSQLParser.
Example:
$sSql = 'Select a, b, c from table1 inner join table2 on (table1.a = table2.a) where b = 900';
# Return array SQL
$aParser = new PHPSQLParser( $sSql );
$aParser = $aParser->parsed;
// I need to intermediate code add fields, conditions, etc. //
// Create the SQL through the array
$creator = new PHPSQLCreator( $this->aParser );
// Show SQL
echo $creator->created;