有谁可以帮我弄清楚为什么以下代码会返回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()', ':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
答案 0 :(得分:5)
您错过了)
VALUES()
VALUES (:id, :message, :scramble_level, :scramble_key)');