Welcome Guest, Not a member yet? Register   Sign In
ORDER BY COUNT
#2

[eluser]pickupman[/eluser]
Have you tried:
Code:
$this->db->select('*, COUNT(category_id) as rows');
$this->db->from('posts');
$this->db->group_by('category_id');
$this->db->order_by('rows','DESC');
$query = $this->db->get();


Messages In This Thread
ORDER BY COUNT - by El Forum - 04-28-2010, 07:36 AM
ORDER BY COUNT - by El Forum - 04-28-2010, 07:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB