Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    56
    Thanks
    6
    Thanked 3 Times in 3 Posts

    Multiple Categories and MySQL

    I am about to write a script, and was wondering how you would go about organizing a database so it each item could have more than one category, I know there are ways of doing this, I am just not sure how.

    Anybody know?

    -Camron
    Free PSD to XHTML/CSS conversion - Dimby.net
    Which doctype should I use?

  • #2
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Supposing you have your items in one table and your categories in another one, you will need a third table, the join table. Each row there will consist of an item id and a category id, and will represent one item-category connection.

  • Users who have thanked venegal for this post:

    Camron467 (05-04-2009)

  • #3
    New Coder
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    56
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Okay, so I think I understand what you are saying. Thanks.
    Free PSD to XHTML/CSS conversion - Dimby.net
    Which doctype should I use?


  •  

    Posting Permissions

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