A PHP function that escapes special characters in a string for use in an SQL statement. This function has been deprecated and should not be used in new code.
mysql_real_escape_string
is a PHP function which is used to escape special characters in SQL string literals, aiming to produce a correct string literal that can be safely used in an SQL statement, without the danger of breaking the query, causing an error or injection.
This should be used for string literals only.
This function is already deprecated, along with the rest of the mysql extension.
The mysql extension has been replaced by the mysqli extension and the PDO library. Both of these have their own escaping functions, but they also both support prepared statements (mysqli, PDO), which should be used instead of manual escaping.