⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

callback_insert/callback_update not work with set_relation_n_n



Angga Pino

Angga Pino
  • profile picture
  • Member

Posted 29 January 2014 - 18:04 PM

Hello guys, Can you help me please?

 

when I use session userdata and datetime in callback_insert/callback_update, and then I also use to set_relation_n_n. It can't be saved.

 

This my set_relation_n_n:

$crud->set_relation_n_n('category_island', 'island_category', 'table_category', 'id_island','id_category', 'category','queue_category');

This my callback_insert & callback_update:

 function author_callback($post_array)
    {

            $data = array(
                 'id_user' => $this->session->userdata['id_user'],
                 'create_time' => date('Y-m-d H:i:s')
             );
            $post_array['id_user'] = $data['id_user'];
            $post_array['create_time'] = $data['create_time'];
            return $this->db->insert('island',$post_array);
            
        
    }

    function author_callback2($post_array)
    {

            $data = array(
                'id_user' => $this->session->userdata['id_user'],
                'create_time' => date('Y-m-d H:i:s')
             );
            $post_array['id_corrector'] = $data['id_user'];
            $post_array['create_time'] = $data['create_time'];
            $this->db->where('island.id_island',$this->uri->segment(4));
            $this->db->update('island',$post_array);
            return TRUE;
        
    }

when not use callback_insert/callback_update or set_relation_n_n, then it works fine.

 

 


jgalak

jgalak
  • profile picture
  • Member

Posted 03 February 2014 - 22:12 PM

NM, please delete reply.