Open a-bentofreire opened 6 years ago
If I activate mysql-syntax extension, the following code will consider the comment below and the echos as strings:
<?php $sql = 'SELECT users.username as u1, users2.username as u2' .' users.username as u3, users2.username as u4'; // echo "sql:$sql\n"; // DEBUG INFO echo "hello world"; echo "hello world";
However If I remove the as u2, this problem stops from occurring. The code below has no problems:
as u2
<?php $sql = 'SELECT users.username as u1, users2.username' .' users.username as u3, users2.username as u4'; // echo "sql:$sql\n"; // DEBUG INFO echo "hello world"; echo "hello world";
mysql-syntax disabled:
mysql-syntax enabled:
mysql-syntax enabled but no as u2:
Another example of this that I encountered was:
<?php $test = "SELECT count(*) FROM (SELECT * FROM table) AS subquery"; print($b);
where the ways I found to fix this was:
AS subquery
If I activate mysql-syntax extension, the following code will consider the comment below and the echos as strings:
However If I remove the
as u2
, this problem stops from occurring. The code below has no problems:mysql-syntax disabled:
mysql-syntax enabled:
mysql-syntax enabled but no
as u2
: