Welcome Guest, Not a member yet? Register   Sign In
Begin Transaction Not Work

Sorry everyone i need help about using trans_begin() to handle mutiple insert with multi table, im try  to insert data "Tagihan" after insert data 'Santri' but ihave a problem. in query insert data "Santri" is success but not in "Tagihan" because in "Tagihan" field "biaya_id" is unknown..

i mean with trans_begin the Data will be rollback or not insert when getting error in query...
PHP Code:


       $santri_id $this->db->insert_id();
       $kelas_id  $data['kelas_id'];

       $this->db->select('biaya_id, nominal');

       $query  $this->db->get();

       if ($query->num_rows() > 0){
           foreach ($query->result_array() as $biaya) {

       if ($this->db->trans_status() === FALSE) {

           return true;
       } else {

           return false;

Messages In This Thread
Begin Transaction Not Work - by bocahapi - 07-17-2018, 07:23 PM
RE: Begin Transaction Not Work - by Pertti - 07-17-2018, 11:43 PM

Theme © iAndrew 2016 - Forum software by © MyBB