Hi, i am developing a site at the moment and i need to work on the Notification Settings for my members.
I have 'members' table in my database that contains info such as:
- first name
- last name
I have on average 10 different notification and email settings that each user can customise, such as:
[ ] email me when i am sent a new private message
Should i expand the 'members' table and add the 10 notification settings or should i create a separate 'notifications' table that will hold all of the notification settings and link it to the 'members' table with a foreign key, thanks in advance for you help...
I would say it depends. if each member only has one row in the members table and they are likely to only have one row in the notifications table then I would just have one table that handles all of it. You aren't expanding your members table be many columns (10) so that wouldn't be a problem. Easier to script and maybe less round trips to the database when calling your values, unless of course you are great with joining multiple sql statements to pull values from different tables at the same time (I still find them a bit of a pain sometimes).
If your notifications table is likely to have multiple rows per member then definitely go for the second option as Charles says. Also if your database is likely to grow with more and more values being added as you go along then again it maybe better to have a separate notifications table.
Just my opinion. Hope I've not complicated things. :-)