1
I have the following lines in Codeigniter: Line 217
if ($query->num_rows() == 0)
{
$this->sess_destroy();
return FALSE;
}
Displays the following error:
Fatal error: Call to a Member Function num_rows() on a non-object in php file on line 217
What can it be? It previously worked perfectly... Only I reinstalled the machine and now it’s given this problem. I’m using the Codeigniter and the Easyphp for testing.
If I trade the line for if (count($query) == 0)
, will work fine, however, then I would have to change everywhere I use the num_rows
, and inside the server works right.
post the variable line
$query
– Alisson Acioli
This line was taken from Session.php of codeigniter, in this situation I am checking if the user exists... however, if I change as I said in the question, use Count, it works... but I would have to use Count in everything...
– Sr. André Baill
For starters,
$query->num_rows()
is different fromcount($query)
. First understand what you’re doing, you’re just trying everything without even understanding what’s going on. Your database connection is working properly?– William Okano
Yes, it is normal...
– Sr. André Baill