请教以下几个函数的区别:一、mysql中:
mysql_escape_string
mysql_real_escape_string二、mysqli中:
escape_string
real_escape_string
mysqli_real_escape_string
mysqli_escape_string       //是mysqli_real_escape_string的别名

解决方案 »

  1.   

    mysql_real_escape_string应是最安全的他考虑字符集进行转义
      

  2.   

    You should use mysql_real_escape_string() instead! This function is identical to mysql_real_escape_string() except that mysql_real_escape_string() takes a connection handler as its first argument and escapes the string according to the current character set. mysql_escape_string() does not take a connection argument and does not respect the current character set.