You need to use the SQL AS feature, where you assign a new name to a piece of data. For example:
$this->db->select("COUNT('foo') AS foo_count", FALSE);// Run your query, and then use the foo_count variable.