[eluser]mrwilson1[/eluser]
I have a query I am trying to write but not getting data back from it.
The query is :
Code:
SELECT DISTINCT `visitor_agent`, COUNT(`visitor_agent`)AS count FROM `visitor` group by `visitor_agent` order by count desc";
I am writing it out as
Code:
function browsers(){
$this->db->distinct('visitor_agent');
$this->db->select('COUNT(visitor_agent)AS count');
$this->db->group_by('visitor_agent');
$this->db->order_by('count', 'desc');
$query = $this->db->get('visitor');
return $query->result();
}
I am getting about half the numerals from the count cloumm that I expect, and none of the distinct visitor_agent.
Does this query look right? Thanks