Hi,
I have a scenario in which i am stuck with in my custom shopping cart.
I have tables of category and product.Each product is against some category. for example
Category Table
Fields are catid, parentid, catname
Data
catid = 1, parentid = 0, catname = Electroics
catid = 2, parentid = 1, catname = Computers
catid = 3, parentid = 2, catname = Sony
catid = 4, parentid = 2, catname = HP
Product Table
Fields are prodid, catid, prodname
Data
prodid = 1, catid = 3, prodname = VAIO Laptops
prodid = 2, catid = 3, prodname = VAIO Desktop
prodid = 3, catid = 3, prodname = VAIO Signature Collection
prodid = 4, catid = 4, prodname = HP Laptops
prodid = 5, catid = 4, prodname = HP Desktop
Now what i want that when some one select category computers then it will get all the records which are either Sony Products or HP Products. I want to write MySQL query but unable to write. Can come one guide me how can i write query for this...?