Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dbh->beginTransaction();
- $statement = $dbh->prepare("INSERT INTO TABLE (field1, field2) VALUES (:v1, :v2)");
- $stmt->bindParam(':v1', $value1);
- $stmt->bindParam(':v2', $value2);
- for ($i = 0; $i < 300; $i++) {
- $value1 = 'value';
- $value2 = 'another value';
- $stmt->execute();
- }
- $dbh->commit();
- //On error should call $dbh->rollback();
Add Comment
Please, Sign In to add comment