mysql_real_escape_string and addslashes are both used to escape data before the database query, so what’s the difference? (This question is not about parametrized queries/PDO/mysqli)
mysql_real_escape_string and addslashes are both used to escape data before the database query, so
Share
They affect different characters.
mysql_real_escape_stringis specific to MySQL. Addslashes is just a general function which may apply to other things as well as MySQL.