gotornot Posted October 19, 2009 Share Posted October 19, 2009 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 More sharing options...
Garethp Posted October 19, 2009 Share Posted October 19, 2009 Is that code within a class? Because if not, that's your problem right there Link to comment https://forums.phpfreaks.com/topic/178206-any-ideas/#findComment-939556 Share on other sites More sharing options...
JAY6390 Posted October 19, 2009 Share Posted October 19, 2009 Yep sounds like this function has been taken out of the original class and called directly Link to comment https://forums.phpfreaks.com/topic/178206-any-ideas/#findComment-939564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.