Reputation: 1820
I am working on an online jewelry store website. One of the requests is that from the back end a color/colors can be chosen for a single piece of jewelry so that users would be able to sort/view only items that are for instance green.
What is the best way to store this in a database? Should this be done with 3 tables:
Is this the correct way to do it? I am using php and mysql but I think this is just a pretty standard database question.
Upvotes: 1
Views: 1040
Reputation: 174957
Yes, your solution with a many-to-many relationship between tables sounds good for your case. You can then easily JOIN the tables to get information out of the IDs.
Upvotes: 2