Code:
(PHP 4 >= 4.3.0, PHP 5)
mysql_real_escape_string — Escapes special characters in a string for use in an SQL statement
Code:
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future.
Instead, the MySQLi or PDO_MySQL extension should be used.
See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
- mysqli_real_escape_string()
- PDO::quote()
Code:
mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00, \n, \r, \, ', " and \x1a.
@dTantra all the websites that were released here work with MSSQL not MySQL. If you want to scape characters on MSSQL you must use two single quotes. But the problem here is not exploiting a string variable, instead what is being exploited is an int variable so escaping characters doesn't help to much if the injection method is using HEX as the video above.