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
Post a Comment