[eluser]invision[/eluser]
Hi,
I'm getting this error on this function:
"Call to a member function on a non-object".
I have marked in the code where the issue arises.
Code:
<?php
class MPages extends Model{
function MPages(){
parent::Model();
}
function getPageBySlug($slug){
$data = array();
**** $this->db->where('slug',$slug); ****
$this->db->limit(1);
$Q = $this->db->get('pages');
if ($Q->num_rows() > 0){
$data = $Q->row_array();
}
$Q->free_result();
return $data;
}
I'd love to get some help with this. Planned to make a decent dent on a project today and fallen at the first
Many thanks for any ideas.