If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
$sql = "INSERT INTO orders (title, quantity) VALUES (:title, :quantity)";
$stmt = $this->db->prepare($sql);
foreach ($records as $record) {
$stmt->bindValue(":title", $record['title']);
$stmt->bindValue(":quantity", $record['quantity']);
$stmt->execute();
}
$values = [];
foreach ($records as $record) {
$values[] = "(:title{$i}, :quantity{$i})";
$stmt->bindValue(":title{$i}", $record['title']);
$stmt->bindValue(":quantity{$i}", $record['quantity']);
$i++;
}
$sql = "INSERT INTO orders (title, quantity) VALUES " . implode(',', $values);
$stmt = $this->db->prepare($sql);
$stmt->execute();
If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
Page created in 0.159 seconds with 12 queries.