Reputation: 1
I following code is giving me error "Fatal error: Call to a member function num_rows() on boolean"
$query = $this->CI->db->get($this->sess_table_name);
if ($query->num_rows() == 0)
{
$this->sess_destroy();
return FALSE;
}
Upvotes: 0
Views: 62
Reputation: 26258
Call to a member function num_rows() on boolean
means your query:
$this->CI->db->get($this->sess_table_name);
is fails due to some error and it returns FALSE, which is the the return type of select
query in case of failure.
So first of all check what $this->sess_table_name
contains in it and after that print RAW QUERY
by using:
$this->db->last_query();
and check what is the issue.
Upvotes: 1
Reputation: 721
You can insert a var_dump
before if
statement. $query
must be false
.
Maybe two reasons:
$this->sess_table_name
is not a valid data table name.Upvotes: 0