任何人都可以帮我弄清楚为什么以下代码返回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));
Run Code Online (Sandbox Code Playgroud)
这导致:
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
Run Code Online (Sandbox Code Playgroud)
你正在把你的结束括)起来VALUES()
VALUES (:id, :message, :scramble_level, :scramble_key)');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
106 次 |
| 最近记录: |