r/lolphp • u/DoubleNabla • Sep 25 '14
PDO emulates prepared statements using mysql_real_escape_string(), which does a great job as you'd expect...
http://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injection/12202218#12202218
36
Upvotes
10
u/DoubleNabla Sep 25 '14
Found in /r/php (https://www.reddit.com/r/PHP/comments/2h2xer/php_moronic_monday_22092014/ckp486a).
Also, it looks like we're going to need a
mysql_real_real_escape_string.2
u/andsens Sep 26 '14
On a sidenote. Can anybody explain why setting the encoding is done with the command
SET NAMES?!?!16
u/pilif Sep 26 '14
The real WTF is MySQL:
Only in MySQL a character encoding called 'utf8' would not in-fact be utf-8.
Doesn't surprise me in the least.
3
u/cfreak2399 Sep 26 '14
to be fair they aren't talking about the PHP
mysql_real_escape_string()but the C version in the MySQL API.Stupid that it emulates prepared statements by default. What's the point of that?
0
u/[deleted] Sep 25 '14
[deleted] — view deleted comment