⚠ 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

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



abypaul

abypaul
  • profile picture
  • Member

Posted 31 October 2015 - 08:51 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
 

 

[attachment=1029:GroceryGruid.png]