How can i Group and order in same query ? I want to use order by so that the categoryb are in Alphabetical no matter what order it is in database. I tried to add ORDER by c.cateogryb after the group and it didnt work for me..
below is the code...
$query = "SELECT s.subcat,
COUNT(s.subcat) AS num,
c.*
FROM subcat AS s,
categoryb AS c
WHERE categoryg='$cate' AND s.subcat=c.categoryb and status='1'
GROUP BY c.catb_id";