Welcome Guest, Not a member yet? Register   Sign In
num_rows() function does not work
#3

(07-22-2015, 10:00 AM)swand Wrote:
Code:
       $this->db->distinct();
       $query = $this->db->get('products');
       /*does not work*/
       echo $query->num_rows(); // this line does not work
       echo count($query->result_array()); // this line works

If I print_r($query) then num_rows, then it shows empty.

$query->num_rows is not the same thing as $query->num_rows(), and $query->num_rows generally will be empty until you've called $query->num_rows() or some result method on $query.

If $query->num_rows() does not work (as opposed to $query->num_rows), what database driver are you using?
Reply


Messages In This Thread
num_rows() function does not work - by swand - 07-22-2015, 10:00 AM
RE: num_rows() function does not work - by CroNiX - 07-22-2015, 10:43 AM
RE: num_rows() function does not work - by mwhitney - 07-22-2015, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB