vikramkakar / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

User variable isn't supported in PHPSQLCreator #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. $parser = new PHPSQLParser('SELECT * FROM `users` WHERE id_user=@ID_USER');
2. $creator = new PHPSQLCreator($parser->parsed); 

What is the expected output? What do you see instead?
Expected output is 'SELECT * FROM `users` WHERE id_user=@ID_USER'.
Instead an exception is thrown.

What version of the product are you using? On what operating system?
I'm using version from 2012-08-22.

Please provide any additional information below.

Original issue reported on code.google.com by kline...@gmail.com on 5 Nov 2012 at 11:11

GoogleCodeExporter commented 8 years ago
This specific issue has been solved, but there are a lot of problems around 
user variables.

Original comment by pho...@gmx.de on 1 Nov 2013 at 4:18

GoogleCodeExporter commented 8 years ago
Variables can be quoted like @`haha`, @'hoho' or @"huhu". Is it necessary to 
remove the quotes and return the raw name of the variable?

I have added some code to handle assignments without SET. See r412.

Original comment by pho...@gmx.de on 4 Nov 2013 at 3:58

GoogleCodeExporter commented 8 years ago
I have enhanced the parser with a "no_quote" property, which holds the variable 
names without @ and without quotes.

Original comment by pho...@gmx.de on 6 Nov 2013 at 7:51