Copy link to clipboard
Copied
Hi. This question relates more to database structure than anything else but I hope someone can please help.
I have a 'catalogue' of products which need to be put on a database driven website. Around 200 products. Many products fall into 2 categories but some fall into more.
For example: A wooden rolling pin my fall under 'Wood', 'Cooking' and 'Dough Accessories'.
What would be the best way of designing my database so that I have the most flexibility for product navigation in the future.
As it stands, I have all the products, descriptions, etc in a flat-file database. The products have not been given any categories. My only idea has been to add 3 more fields each saying 'Category 1' 'Category 2' and 'Category 3'. Would this work?
Thanks!
Chris
P.S. If I have not been clear enough please say.
Copy link to clipboard
Copied
>My only idea has been to add 3 more
>fields each saying 'Category 1' 'Category 2' and
?>'Category 3'. Would this work?
You could make this work, but it's the wrong approach and will cause major headaches for you. The correct method would be to create a category table, and another table that links the categories to the products. Each row in the link table would contain the primary keys from the product and category table.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now