[eluser]Christophe28[/eluser]
Hello,
I have a 2 variables which I have available in a method. I want to pass these to the model, but I don't know how.
I'm new in CI and OOP -> but I hope somebody can help me ...
For now I have:
Code:
function photo_view_function($username, $caption)
{
// loading the model
$this->load->model('mediamanager_model', array('caption' => $caption, 'username' => $username));
$data['photo'] = $this->mediamanager_model->getSinglePhoto();
$data['caption'] = str_replace('_', ' ', $caption);
$data['main_content'] = 'single_photo_view';
$this->load->view('template', $data);
}
And the model
Code:
function getSinglePhoto($username, $caption) {
$this->db->get_where('mediamanager', array('caption' => $caption, 'username' => $username));
$sql = $this->db->get();
$result = $sql->result();
return $result;
}
But no mather what I try, I get errors
Can someone help me plz
Thx!