php - Database transaction not working in controller codeigniter -


i calling multiple models in controllers , models database query. did this

public function insertsale()     {             $this->db->trans_start(true);             // logic part , models calling insert/update/delete              $this->db->trans_complete(); } 

above code not working if fails after queries dont rollback.

having true in $this->db->trans_start(true); put transaction in test mode means regardless of happens query rolled back.

if wanted see if query work use:

$this->db->trans_status(); 

which return either true/false depending on outcome.

(i realise old question, however, thought should put answer in here incase else came looking.)

hope helps!


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -