To prevent SQL injection, is it necessary to use mysql_real_escape_string()
, when magic_quotes_gpc
is on?
Looking at the documentation; http://php.net/manual/en/function.mysql-real-escape-string.php
Note: If magic_quotes_gpc is enabled, first apply stripslashes() to the data. Using this function on data which has already been escaped will escape the data twice.
You can check if magic_quotes_gpc is on, see example; http://php.net/manual/en/function.get-magic-quotes-gpc.php