I want to be able to add something into multiple categories.
Currently, when I add something to the database, I choose a category, for example: "Red" with the ID of 1
That item then belongs to the Red category.
I have a category page which selects everything for category 1 "Red".
All red items are displayed on page.
What I want to know is, how to do multiple categories?
What if an item is Red and Blue?
Category 1 - Red and Category 2 - Blue
How do I insert it into the database to be 1,2 and how do I select that item as just 1 for the Red category but then it is also in the Blue category when you look there?
Hope my example was okay :x
You need Three tables.
The prod_cat table will allow you to list the product id many times to different categories. Hope this helps (Same Advice as Kalon)
You could have a separate table called "prodCats" which has a 1 to many relationship with your "products" table. prodCats would have a record for each product and the categories it is in. You could have foregn keys in prodCats to make sure that the prodId and catId exists in your "products" and "categories" tables.