hi I need help urgently

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

hi I need help urgently

Post by gotornot »

Hi i need real help ive been dumped in the poop by my ex developer.

I am a coder but only a basic one I have this being shown below:

Fatal error: Call to a member function on a non-object in /home/adcentre/lib/class.ad-connector.php on line 359

this is the function it is talking about:

Code: Select all

 
function ad_status($id)
    {
        $id = (int)$id;
 
        $q = 'SELECT status FROM advert WHERE id = '.$id;
        $this->db->safe_query($q, __FUNCTION__, __LINE__);
 
        if (!$this->db->num_rows())
        {
            return ADCON_STATUS_ABSENT;
        }
 
        $status = $this->db->result();
 
        if ($status == 1)
        {
            return ADCON_STATUS_ACTIVE;
        }
 
        return ADCON_STATUS_SUSPENDED;
    }
 
Any ideas?????
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

We don't know where this code is inside the file, or anything about it's context. What line here is line 359?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: hi I need help urgently

Post by McInfo »

My guess is that $this->db has not been initialized as an object.

Edit: This post was recovered from search engine cache.
Post Reply