我收到与此类似的查询错误,但我还没有发现问题:
$str = "rob's";
...
$query ="INSERT INTO tableName (name) VALUES (mysql_real_escape_string('$str')";
编辑:
我道歉。我在减少代码时犯了一个错误;这更接近我所拥有的错误:
$str = "rob's";
...
$query ="INSERT INTO tableName (name) VALUES (('".mysql_real_escape_string($str)."')";