【发布时间】:2018-09-07 13:06:18
【问题描述】:
我有一个数据数组,例如这个:
$data = ['ver_weather' => $post["weathercondition"],
'ver_flash' => $post["flashintense"],
'ver_earth' => $post["earthrumble"]]
我在我的 sql 中使用的这些数据是这样的:
$sql = "INSERT INTO `database`.`table` (`weather`, `flash`, `earth`)
VALUES (:ver_weather, :ver_flash, :ver_eart)";
$pdo->prepare($sql)->execute($data);
结果是这样的:
INSERT INTO `database`.`table` (`weather`, 'flash', `earth')
VALUES ('1'weather, '1'flash, '1'earth)
那么 pdo 是否用值替换了我的部分键?
那里有什么问题?
感谢您帮助我。
【问题讨论】:
标签: mysql arrays pdo prepared-statement