Phpmysql_escape_string and addslashes. For details about the differences between phpmysql_escape_string and addslashes, refer to this article. The mysql_real_escape_string () function escapes special characters in strings used in SQL statements. For details about the differences between php mysql_escape_string and addslashes, refer to this article.
The mysql_real_escape_string () function escapes special characters in strings used in SQL statements.
The following characters are affected:
• X00
• N
• R
•
•'
•"
• X1a
If yes, the function returns the escaped string. If it fails, false is returned.
The addslashes () function adds a backslash before the specified predefined character.
The predefined characters are:
• Single quotes (')
• Double quotation marks (")
• Backslash ()
• NULL
Difference summary
The difference between mysql_escape_string and addslashes is that
Mysql_escape_string always converts "'" to "'"
And addslashes
Convert "'" to "'' "when magic_quotes_sybase = on
Convert "'" to "'" when magic_quotes_sybase = off
Http://www.bkjia.com/PHPjc/629045.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/629045.htmlTechArticlephp mysql_escape_string and addslashes detailed differences, you can refer to this article. The mysql_real_escape_string () function escapes special characters in strings used in SQL statements. The following words...