CodeIgniter Forums
I have a problem with $query->num_rows(); - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: I have a problem with $query->num_rows(); (/thread-9431.html)

I have a problem with $query->num_rows(); - El Forum - 06-25-2008

In hosting I have this code:
48: $query = $this->db->query('SELECT * FROM table where field="'.$query_string.'" LIMIT 1');
49:        if ($query->num_rows()==0)
50:         {

After run this code and if SELECT command return noany data record - error occures:

Fatal error: Call to a member function num_rows() on a non object in file1 on line 49

This code works fine in my developer computer. What's wrong? CI 1.6.2.