In a scenario I need to know the count of recordset a query will return, which in codeigniter can be done by $query->num_rows() or $this->db->cou
Simply as bellow;
$this->db->get('table_name')->num_rows();
This will get number of rows/records. however you can use search parameters as well;
$this->db->select('col1','col2')->where('col'=>'crieterion')->get('table_name')->num_rows();
However, it should be noted that you will see bad bad errors if applying as below;
$this->db->get('table_name')->result()->num_rows();