CodeIgniter Active Record - Get number of returned rows

Solution 1:

Have a look at the result functions here:

$this->db->from('yourtable');
[... more active record code ...]
$query = $this->db->get();
$rowcount = $query->num_rows();

Solution 2:

AND, if you just want to get a count of all the rows in a table

$table_row_count = $this->db->count_all('table_name');