⚠ 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 forum is read-only and soon will be archived. ⚠


aida

Member Since 29 Oct 2015
Offline Last Active Private
-----

Topics I've Started

grocery crud model-database updating-error

29 October 2015 - 07:29 AM

public function services()
{
$username=$this->session->userdata('username');
if($username!='')
{
$crud = new grocery_CRUD();


$crud->set_table('tbl_services');

$crud->set_subject('Services');
$crud->columns('s_id','s_companyname','s_type','s_country','s_state','s_district','s_email','s_mobile','s_photo','s_active');
$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'));

//$crud->set_relation('q_id','tbl_discussionanswer','q_id');
$output = $crud->render();
$this->_admin_output($output);
}
else
{
$this->index();
}

 

 

 

this is my controller function in admin side.but the values are inserted into databse as their corresponding id not the value.but i need the value.then only the client side works properly. plz help me


database the values are inserted as id from admin side

29 October 2015 - 06:38 AM

public function services()
{
$username=$this->session->userdata('username');
if($username!='')
{
$crud = new grocery_CRUD();


$crud->set_table('tbl_services');

$crud->set_subject('Services');
$crud->columns('s_id','s_companyname','s_type','s_country','s_state','s_district','s_email','s_mobile','s_photo','s_active');
$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'));

//$crud->set_relation('q_id','tbl_discussionanswer','q_id');
$output = $crud->render();
$this->_admin_output($output);
}
else
{
$this->index();
}

 

 

 

 

this is ma controller function.in table all details are correctly inserted.but in database s_type','s_country','s_state','s_district', for these the corresponding id are inserted.but i want the value itself.plz help me.