无法弄清楚这个查询出错的地方......
收到此错误:
{"databaseException":"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 'desc) \n VALUES (1, array)' at line 1"
来自此查询
$statement = $db->prepare(
"INSERT INTO `descriptions` (vrm, desc) VALUES (:vrm, :description)"
);
if ($statement->execute(array(
':vrm' => '1',
':description' => $_POST['desc'])));
谢谢!
答案 0 :(得分:2)
您应该向desc
列名称添加反引号。这是一个保留字(ORDER BY vrm DESC)。