Welcome Guest, Not a member yet? Register   Sign In
I have a problem with $query->num_rows();
#1

[eluser]Unknown[/eluser]
In hosting I have this code:
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.




Theme © iAndrew 2016 - Forum software by © MyBB