当我使用此循环遍历动态HTML表单时,似乎无法绑定输入值:
$stmt= $pdo->prepare('INSERT INTO certification (document,regdate,expires) VALUES (:document,:regdate,:expires)');
foreach ($_POST as $key => $value) {
foreach($value as $key1 => $value1){
$database->bind(':document', $value1);
$database->bind(':regdate', $value1);
$database->bind(':expires', $value1);
}
};
$database->execute();
这将引发错误:SQLSTATE [HY093]:无效的参数编号:参数未定义。
任何帮助都会很棒。谢谢