假设我有这段代码:
$stmt = $pdo->prepare('INSERT INTO example (column1, column2) VALUES(:value1, :value2)');
$stmt->bindValue('value1', $_POST['value1']);
foreach ($_POST['something'] as $something) {
$stmt->bindValue('value2', $something);
$stmt->execute();
}
$stmt->execute()
会清除之前的value1
绑定吗?我是否必须在每个循环中重新绑定它?
TL; DR PDOStatement::execute
是否清除以前的绑定?