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();