codeigniter get num_rows

PHP
// num rows example
$this->db->select('*');
$this->db->where('whatever');
$query = $this->db->get('table');
$num = $query->num_rows();
Source

Also in PHP: