Codeigniter transaction Codeigniter transaction codeigniter codeigniter

Codeigniter transaction


It works OK now with manually setting the trans_status

$this->db->trans_begin();$a = 'UPDATE ......'; RETURN TRUE$b = 'INSERT INTO......'; RETURN FALSE$this->db->trans_rollback(); //First transaction ends it will return FALSE always(in my case)$this->db->_trans_status = TRUE; // setting the trans_status manually ,so it will ignore previous attempts $this->db->trans_begin();//other operations ..if ( $this->db->trans_status() === FALSE  ) {   $this->db->trans_rollback();} else {       $this->db->trans_commit();    }


I think you need add this before transaction start:

$this->db->trans_strict(FALSE);

By default CodeIgniter runs all transactions in Strict Mode.

When strict mode is enabled, if you are running multiple groups of transactions, if one group fails all groups will be rolled back.