[eluser]Matalina[/eluser]
*edited out prior post*
You shouldn't have to do what you are doing with the select just use the $query->num_rows();
Code:
$sql = "my query here";
$query = $this->db->query($sql);
return $query->num_rows();
All you are doing in your code is selecting the count of for each row which will be the same and then counting the rows anyway when you return num_rows();