Jump to content

Recommended Posts

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:

 

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?????

Link to comment
https://forums.phpfreaks.com/topic/189046-hi-i-need-help-urgently/
Share on other sites

The . is for concatenation. I dont think that is his/her problem.

 

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

 

The function you posted, is that called from line 359 in file class.ad-connector.php?

 

The error is saying that you are trying to call a function that is a method of an object of a particular class, but you are trying to call said function "on a non-object". Now I don't use OOP very often, but I'm guessing you may have a typo in your code. Imagine you have an object: $object that has a method "function". To call the method you do: $object->function(); (i think) but say you do a typo when type object so you have $pbject->function(); now you are trying to Call to a member function on a non-object.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.