Guest User

Untitled

a guest
Oct 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. $dbh->beginTransaction();
  2. $statement = $dbh->prepare("INSERT INTO TABLE (field1, field2) VALUES (:v1, :v2)");
  3. $stmt->bindParam(':v1', $value1);
  4. $stmt->bindParam(':v2', $value2);
  5.  
  6. for ($i = 0; $i < 300; $i++) {
  7. $value1 = 'value';
  8. $value2 = 'another value';
  9. $stmt->execute();
  10. }
  11.  
  12. $dbh->commit();
  13.  
  14. //On error should call $dbh->rollback();
Add Comment
Please, Sign In to add comment