Welcome Guest, Not a member yet? Register   Sign In
Error - "Call to a member function on a non-object" - Any ideas?
#1

[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 Sad


Many thanks for any ideas.


Messages In This Thread
Error - "Call to a member function on a non-object" - Any ideas? - by El Forum - 02-27-2010, 09:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB