Answer the question
In order to leave comments, you need to log in
How to implement counting products in a category?
There are two tables: one with products, the second with categories.
The first table has a products_cat field that stores a link to the sub_name field in the second table.
As a result, I pull out the list of subcategories through the query:
SELECT * FROM categories where left_key >:left and right_key <:right ORDER BY name
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question