Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter Active Record - Get number of returned rows

I'm very new to CodeIgniter and Active Record in particular, I know how to do this well in normal SQL but I'm trying to learn.

How can I select some data from one of my tables, and then count how many rows are returned using CodeIgniters Active Record class?

Thanks, Tom.

like image 539
Zim Avatar asked Aug 03 '09 14:08

Zim


1 Answers

Have a look at the result functions here:

$this->db->from('yourtable'); [... more active record code ...] $query = $this->db->get(); $rowcount = $query->num_rows(); 
like image 127
Residuum Avatar answered Sep 20 '22 07:09

Residuum