[eluser]Unknown[/eluser]
Hello,
I have a URL in a link on my view similar to the following:
Code:
<a href="example.com/class/gather/123">
I see how to access the ID segment in the controller:
Code:
function gather($id)
{
echo $id;
}
But I'd like to something like the following in my model:
Code:
$this->load->database();
$this->db->where('person_id', $id);
$this->db->from('people');
$query = $this->db->get('');
Access the record in the database corresponding to that ID value. Pass that back to the controller, then to the view.
I get an error about undefined variable in the model. What do I have to do to pass the value of $id to the model from controller? I didn't see any examples of this.
Thanks for the help in advance!