CodeIgniter Forums

Full Version: ORDER BY COUNT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Order the category according to the number of post..

Is thre any idea about how i sort a category list using the count of post..

in my case count is an integer number but how it use with an ORDER BY me plz..

El Forum

Have you tried:
$this->db->select('*, COUNT(category_id) as rows');
$query = $this->db->get();