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?
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