SQL插入错误1064

时间:2016-08-09 19:00:47

标签: php sql

毫无疑问,我在这里遗漏了一些非常简单的内容,但我无法看到此查询产生以下错误的问题

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' in C:\camel\www\includes\ajax\msg.php on line 17

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads) VALUES('2', '1', '2', 'a q from buyer omar', 'how much is the cola overt' at line 1 in C:\camel\www\includes\ajax\msg.php on line 17

我的代码

$statement = $db->prepare("INSERT INTO msg(userid, resuserid, msgtype, title, msg, reads)
VALUES(:userid, :resuserid, :msgtype, :titles, :msg, :reads)");
$statement->execute(array(
"userid" => "2",
"resuserid" => "1",
"msgtype" => "2",
"titles" => "a q from buyer omar",
"msg" => "how much is the cola overthere",
"reads" => "no"
));

0 个答案:

没有答案