Jump to content


add function in set_relation_n_n not work

set_relation_n_n

  • Please log in to reply
1 reply to this topic

#1 Alfandi Nurulmukhlis

Alfandi Nurulmukhlis

    Member

  • Members
  • PipPip
  • 16 posts

Posted 01 October 2013 - 11:35 AM

please help me again..

sorry for my bad english..

i have code in table "user", i give function set_relation_n_n but add function not work properly, but when i edit , it works properly

i have table relation :

grocery user table.PNG

i add record:
grocery when insert user.PNG

but it not saved in field relation_n_n:
grocery user add.PNG

 

in table "room_access" not saved:

grocery acces room.PNG

when i edit table "user", it work properly:
insert well.PNG

table "acces_room" view:
access room insert well.PNG

this is my code:

public function user()
    {
        $this->grocery_crud->set_table('user');
        $this->grocery_crud->set_subject('User');
        $this->grocery_crud->required_fields('Rfid','Id_User','Nama_User','Id_Status','Room_Access');
        
        $this->grocery_crud->display_as('Id_Status','Status');
        $this->grocery_crud->set_relation('Id_Status','status','Nama_Status');
        $this->grocery_crud->set_relation_n_n('Room_Access','room_access','ruang','Rfid','Ip','Nama_Ruang');
        
        $output = $this->grocery_crud->render();
        $this->crud_output($output);
    }

 


help me.., thanks in adv..



#2 Alfandi Nurulmukhlis

Alfandi Nurulmukhlis

    Member

  • Members
  • PipPip
  • 16 posts

Posted 02 October 2013 - 04:22 AM

My analysis :

in main table "user", primary key must integer and AutoIncrement, that's work properly

if primarykey in main table Varchar, that's doesn't work . . .







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users