any ideas
Posted: Mon Oct 19, 2009 5:34 am
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?
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?