Codeigniter transaction for all queries within a function
this might be helpful to you.transactions in codeigniter
$this->db->trans_begin();$this->db->query('AN SQL QUERY...');$this->db->query('ANOTHER QUERY...');$this->db->query('AND YET ANOTHER QUERY...');if ($this->db->trans_status() === FALSE){ $this->db->trans_rollback();}else{ $this->db->trans_commit();}