Jump to content


grocery crud model-database updating-error

grocerycrud codeigniter updating database insert

  • Please log in to reply
1 reply to this topic

#1 aida

aida

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 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



#2 neha546

neha546

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 29 February 2016 - 07:10 AM

hello friends,

Unfortunately it is not out of date. Well the basic reason is that active record was not able to handle some custom complicated queries that I have in grocery CRUD. They were lot of bugs at active record at that time, that actually was a stopper rather that make my life easier. So it was a decision that I had to made in order to complete grocery CRUD. Of course anyone can create his own model easily as it is organized to be only in one file. If you go to: application/models/grocery_crud_model.php you can see that not many hard coded queries are there.

 

 

 

 

 

Maharaja Express

Rafting in Rishikesh







Also tagged with one or more of these keywords: grocerycrud, codeigniter, updating, database, insert

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users