[eluser]Dizza[/eluser]
Hey everyone,
Im having a problem with loading a model function in my controller function.
First i load the model in my controller with:
Code:
$this->load->model('cmsm');
In my Controller i have:
Code:
function getmsg(){
$this->cmsm->getmsg();
$this->load->view('admin/updateform.php', $data);
}
Then in my model (cmsm.php) i have:
Code:
function getmsg(){
$this->db->where('id', $this->uri->segment(3));
$data['query'] = $this->db->get('content');
}
When i just copy and paste the model function within my controller function i dont get an error. If i do it seperate like this i get this error:
Code:
Severity: Notice
Message: Undefined variable: data
Filename: controllers/cms.php
Line Number: 22
Severity: Notice
Message: Undefined variable: query
Filename: admin/updateform.php
Line Number: 16
Code:
Fatal error: Call to a member function row_array() on a non-object in system/application/views/admin/updateform.php on line 16
What am i doing wrong here?
Thanks!