Jump to content


After $crud->set_relation() program will save corresponding primary key in database

set_relation() callback database

  • Please log in to reply
No replies to this topic

#1 abypaul

abypaul

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 31 October 2015 - 08:48 AM

 
public function loadservices()
{
$crud = new grocery_CRUD();
 
$crud->set_table('tbl_services');
$crud->set_subject('services');
 
$crud->set_relation('s_type','tbl_service_cat','service_desc');
 
$crud->set_relation('s_country','tbl_country','country');
        $crud->set_relation('s_state','tbl_state','state');
   $crud->set_relation('s_district','tbl_district','district');
 
$crud->set_field_upload('s_photo','uploads');
   $crud->callback_after_update(array($this,'rename_serviceimg_db'));
   $crud->callback_after_insert(array($this,'rename_serviceimg_db'));
 
$output = $crud->render();
             $this->_admin_output($output);
}
 
For example the value of service_desc field is kerala but its store its corresponding id in database. So i can use this id in view side.
Please help me to save value kerala in database
 

 

 






Also tagged with one or more of these keywords: set_relation(), callback, database

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users