In CodeIgniter, how can you roll back a transaction in case of an error?

  • $this->db->commit();
  • $this->db->rollback();
  • $this->db->trans_commit();
  • $this->db->trans_rollback();
In CodeIgniter, you can roll back a transaction in case of an error using the $this->db->trans_rollback(); method. This function will undo all queries run after the trans_start() method was called.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *