How to display a list of categories, indicating for each category the number of goods?
Category table:
idcategory int(11); title varchar(255); slug varchar(255);
Product table:
idproduct(int11); title varchar(255); description text; category_id int(11); price decimal(19,2);
select group_name, count(1) as cnt from table_name group by group_name
- BOPOH