Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $this->db->trans_begin();
  2. $q1 = $this->db->query("INSERT INTO `test`(`test_col`) VALUES ('aaaaaa')");
  3. sleep(100000);
  4. $q2 = $this->db->query("INSERT INTO `test`(`test_col`) VALUES ('bbbbbb')");
  5. $this->db->trans_complete();
  6.  
  7. $this->db->trans_begin();
  8. $q1 = $this->db->query("INSERT INTO `test`(`test_col`) VALUES ('duplicated')");
  9. $q2 = $this->db->query("INSERT INTO `test`(`test_col`) VALUES ('new row')");
  10. $this->db->trans_complete();
  11.  
  12. if ($this->db->trans_status() === FALSE) {
  13. // I get this line, but trans_rollback doesn't work
  14. $this->db->trans_rollback();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement