I got functions where i need to work with enterie id . Selecting enterie by id, displaying it and updating rows in DB. Wont copy all the code, just main idea
controllers
function edit_advert()
{
$id = $this->uri->segment(3); //Here i get my enterie id
$this->load->model('model_adverts');
$myadvert = $this->model_adverts->get_enterie($id); //passing id to model function
//where i find enterie, select it from DB and pass it back to controller
//and then do if() stuff, where i give error message or pass returned enterie to
//view and display it .
}
function update_enterie() //in view i got form with values from DB, after editing
//fields, form submits to this function
{
do form validation stuff etc
And here i need to get $id again and pass it to model, so i can do query update
where $id = id
}
So, how i can access that $id variable again ?