php - Why my codeigniter code about transaction does not work? -


my code liked this:

$this->db->trans_strict(false); //close strict mode $this->db->trans_begin(); $updatearr = array('name'=>'test', 'age'=>22); $this->db->where('user_id', $user_id); $this->db->limit(1); $this->db->update('user_table', $updatearr);         $logarr = array('created'=>'2015-07-30', 'content'=>'test' ); $this->db->set($logarr)->insert('log_table');        if ($this->db->trans_status() === false) {                   $this->db->trans_rollback();     return false; } else {     $this->db->trans_commit();     return true; } 
  1. does codeigniter transactions support activerecord?
  2. when first query return false, why second query return true ?

what doing wrong ? please me.

i use mysql innodb


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -