I HAVE TABLE
TABLE CATEGORY
id | name | parent
1 | gadget | 0
2 | phone | 1
3 | laptop | 1
....
TABLE PRODUCT
id | name | cat
1 | post 1 | 2
2 | post 2 | 2
3 | post 3 | 3
....
i want to get product by category and subcategory
Display all product in gadget category
How i can do that ?