示例:以下查询在字段中给我引号错误 -> GET['email']
mysql_query(" select * from user_info where user_mail = '$_GET['email']' ")
最佳答案
您可能想先对字符串进行转义:
$_GET['email'] = mysql_real_escape_string($_GET['email']);
然后:
mysql_query(" select * from user_info where user_mail = '" . $_GET['email'] . "' ");
点将字符串放在一起。
关于php - 如何转义 MYSQL 查询中的引号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6793632/