Jump to content

any ideas


gotornot

Recommended Posts

I previously had a coder work for me now im learning myself the only trouble is some code he did is going wrong and he never made any comments on his work so i cant find out why the error is occuring

 

Here is the code

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;

}

 

This is the error it chucks up:

Call to a member function on a non-object

 

Can anyone else point me in the right direction?

Link to comment
https://forums.phpfreaks.com/topic/178206-any-ideas/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.