I have created a website where i have put category in three levels like Main category -> sub category -> sub sub category
and this category i used in adding product whatever category i selected from the list each product have get in to that category. Now i am trying to display the products category wise on my site there i have put a list buttons where i have display all the category and sub categories now the problem is that when i m going to click on main category it displays only those products which are having that category selected but i want to display the subcategory also if a main category clicks, here is the query:
SELECT * FROM `products` WHERE `product_category`='$_REQUEST[cat]' ORDER BY `product_id` DESC
in this query the request cat is the name of the category which i got on page.
i want to know the query which display the sub category also if a main category is clicked