Linux server. Keep In mind this is at a webhost not here, my local server works just fine but its php as a module not as CGI like my webhost is.
I fixed the first one by doing this:
$this->db->where('ip', $ip);
$this->db->limit(1);
$data['query'] = $this->db->get('banned');
instead of
$query = $this->db->where('ip', $ip)->limit(1)->get('banned');
Okay, but now I’m getting other errors in other places, gah this irrates me cause it works fine locally. Here is the new error and the code.
Fatal error: Call to a member function on a non-object in /home/.leucon/cpccody/codypchristian.net/system/application/controllers/home.php on line 120
line 120:
if ($query->num_rows() > 0)
Here is the full code of this function:
//check the IP and see if its in the banned database
function ip_check($ip)
{
//$query = $this->db->where('ip', $ip)->limit(1)->get('banned');
$this->db->where('ip', $ip);
$this->db->limit(1);
$data['query'] = $this->db->get('banned');
if ($query->num_rows() > 0)
{
//if a match then throw a error
//values returned from database -- must be a match
$this->validation->set_message('ip_check', 'Sorry but your IP matches a IP in the banned list');
return FALSE;
}
else
{
//if not a match then throw no error
return TRUE;
}
}