SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    685
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Articles with Multiple Categories?

    I have a news article site and I'm needing some help on how to arrange the database.

    On the news article site there will be about 200 categories.

    Sometimes Articles will fit into about 80 different categories.

    What is the best way to setup a database that has an article that is assigned to 80+ categories?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Three tables:
    - Articles
    - Categories
    - ArticleCategories

  3. #3
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    685
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What would your column structure be like in: ArticleCategories

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    ArticleId
    CategoryId



    It's a table that contains the relationships between the articles and the categories (which is a many-to-many relationship)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •