Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Product_category table

category_id ---- category_name
1 ------------------ CARS
2 -------------------TRUCKS


Product_list table

Product_id ----- category_id (foreign key)----- Product_name
1 ----------------- 2 -------------------------- Ford trucks
2 ----------------- 1 ------------------------- - Ferrari sports cars
3 ----------------- 1 ---------------------------- Honda coupes

above i have listed my database design... I would assume that a Product_category would contain mulitple subcategories. That means that there is a one-to-many relationship between the Product_category and Product_list tables. In which case, the category ID should be a foreign key in the Product_list table

....i have to create subcategory under a category... its like.. if i click CARS then it MUST show subcategories 1 Ferrari sports cars , 1 Honda coupes if i click TRUCKS it must show 2 Ford trucks... can anyone please help me please write down the php code Thank you
Posted
Updated 25-Mar-14 23:44pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900