• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.