Php PDO stmt->;执行导致MySQL语法错误
有人能帮我弄清楚为什么下面的代码返回MySQL语法错误吗Php PDO stmt->;执行导致MySQL语法错误,php,mysql,pdo,Php,Mysql,Pdo,有人能帮我弄清楚为什么下面的代码返回MySQL语法错误吗 $stmt = $pdo->prepare('INSERT INTO `message`(`id`, `message`, `scramble_level`, `scramble_key`) VALUES (:id, :message, :scramble_level, :scramble_key'); $stmt->execute(array(':id' => 'NOW()',
$stmt = $pdo->prepare('INSERT INTO `message`(`id`, `message`,
`scramble_level`, `scramble_key`)
VALUES (:id, :message, :scramble_level, :scramble_key');
$stmt->execute(array(':id' => 'NOW()', ':message' => $theMessage,
':scramble_level' => $scrambleLevel,
':scramble_key' => $scrambleKey));
这导致:
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 '' at line 3
您在您的
值()周围误用了结束括号)
我真傻,谢谢。
VALUES (:id, :message, :scramble_level, :scramble_key)');