Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
I'm assuming a normal blog here, where each comment must relate to one and only one blog (article?). In that case, the second setup (where you use the article ID as a foreign key) is far superior.
Think about what it would take to find all comments for a given article for each method. Let's say you're working with the article whose ID is 1. In the first scenario you would have:
SELECT * FROM `comments` WHERE `id` IN (SELECT `cid` FROM `bid_cid` WHERE `bid` = 1);In the second scenario you would have:
SELECT * FROM `comments` WHERE `bid` = 1;The second is much simpler, much more efficient, and much more normalized.
I disagree with PettyRider… I can't remember ever seeing an argument for using a join table unless you're modeling a many-to-many relationship. All one-to-many relationships should be modeled using a foreign key unless there's an extremely compelling reason not to do so.
1 to 8 of 8