help with structure visualization

Discussion in 'Databases' started by dethfire, Sep 22, 2010.

  1. #1
    I am creating a newsletter website. Upon registration the user will be able to select theoretically a hundred newsletters to receive. My question is how do I store that data in the database? Each newsletter is unique and each user will have a different selection of choices. I won't want to make 100 different table columns for each newsletter will I? Any ideas?
     
    dethfire, Sep 22, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You want to make a simple relational setup. You need a users table, and a newsletters table, and then a user_newsletters table that links the user to the newsletters. This way a user can sign up for as many newsletters as they want. Each newsletter for each user would have a new row in the user_newsletters table. All the data stays clean and organized.

    Users:
    user_id
    user_info...

    Newsletters:
    newsletter_id
    newsletter_name
    newsletter_content

    User Newsletters:
    un_id
    user_id
    newsletter_id
     
    jestep, Sep 23, 2010 IP
  3. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #3
    You could always use something like SmartDraw to set up diagrams of your dB structure.
     
    mcfox, Sep 23, 2010 IP
  4. Aresm

    Aresm Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thx for that bro, i had the same problem
     
    Aresm, Sep 25, 2010 IP