google SQL Parser edit item before Creation
I am using the sql query parser from google to retrieve a query which i
want to inspect for the tablename. After inspecting, i want to edit the
tablename and use the query parser' function to create the query with the
new tablename.
$parser = new PHPSQLParser();
$creator = new PHPSQLCreator();
$parsed = $parser->parse("SELECT * FROM _originalTableName WHERE ID = 15");
$parsed['FROM'][0]['table'] = '_newTableName';
echo $creator->create($parser->parsed);
But my newly created query is always identical with the original. What am
i doing wrong?
Output always:
SELECT * FROM _originalTableName WHERE ID = 15
No comments:
Post a Comment