How do curly braces affect MySQL syntax?
I accidentally put a PHP statement in MySQL:
select * from info where id={${intval(17a)}}
MySQL gave me an error message:
ERROR 1054 (42S22): Unknown column '17a' in 'where clause'
Why is MySQL not giving a syntax error, empty result, or showing {${intval(17a)}}
in an error message? Column in value id
is equal {${intval(17a)}}
but mysql is talking about column '17a'
? Are curly braces and dollar sign special characters in MySQL?
Demo
+3
while true
source
to share
1 answer
This $ sign is PHP specific syntax.
I think you are just looking for this
select * from info where id='17a';
-3
Usman shahid
source
to share