Heya everyone!
I'm trying to figure out the best way to handle the following challenge. I'm going to have links in a database that will be categorized under a primary category and then multiple sub-categories. I've added an entry in the row for the primary category but haven't figured out yet how I'll handle the secondary categories. I think I've come up with three ways I could handle it, but am not sure if any of them are a good way.
1) An array stored in the link's db row: This seems like a bad way to handle it for when I need to find any links with that category selected as a secondary. I think it would have got deal with each array for every link in the db to check for a match.
2) An array stored in the category's db row: This could become a ridiculously large array, I would think.
3) A table in the DB with an entry for every link <~> category match. If link 100 has 7 sub-categories, it would get 7 entries in that table. To my untrained eye, this seems like the best way to go about it, but I'm almost always wrong about this.
Thoughts and suggestions would be greatly appreciated!