Some people believe that mysql_real_escape_string()
has some flaws and cannot protect your query even when properly used.
Bringing some fossilized articles as a proof.
So, the question is: is mysql[i]_real escape_string() totally unacceptable?
Or is it's still possible to use this function to create your own kind of prepared statements?
With proofcode, please.
From the MySQL’s C API function
mysql_real_escape_string
description:So don’t use
SET NAMES
/SET CHARACTER SET
but PHP’smysql_set_charset
to change the encoding as that is the counterpart to MySQL’smysql_set_character_set
(see source code of /ext/mysql/php_mysql.c).