Tables Design Question

admin

Administrator
Staff member
Okay...I need to design a database according to the following: There will be a list of categories, and a number of listings. Each listing will belong to one or more category. So when you go to that category webpage, all the listings for that category are displayed.

What I have now is a categories table and a listings table, with a category_id field in the listings table that relates back. This is making it difficult for one listing to belong to numerous categories. I've looked into the SET() data type, but I think that is not a good idea. The only thing I can come up with is adding the listing to the listings table twice, once for each category, but that brings up other issues I don't want to have to deal with.

Someone has to have done something like this in the past...can anyone provide some insight? I should mention that I'm using MySQL =)
 
Back
Top