I have two columns in mysql database id_product and id_category i need to get a number of product in one category example if i have ID_Product ID_Category 1 2 2 4 3 4 4 2
it says to me: ID Category 2 (2 Products) ID Category 4 (2 Products)
Thanks
rtfm here: COUNT()
how can i use it in my case?
Something like this:
SELECT COUNT(*) prod_count,ID_category FROM products GROUP BY ID_category