Hi all, i am developing a DB for the website. The scenario is, there are multiple types of subscription forms for the user to register for. So, for each form there are some fields that are common. I have tried to put the common fields and the user's personal detail in the single table. BUT, when the forms (subscriptions' types )will get more than I had to add more fields to the same user table. Should i do this, or should I make a new table for each subscription form. I am just avoiding the form-specific table in order to have one type of field in more than 1 table. any suggestions..? help appreciated
I suggest keeping common fields into one table and creating separate tables for different subscriptions by keeping the specific relational userid into
i also think so, but the problem will comes when common fields become more in number... apart from that, i used to create tables using phpmyadmin, and to have a Foreign Key in some table, i goto > "Relational View" and than add "Internal Relations".... does this work instead of explicitly creating a Foreign Key,,,,if I have to explicitly add the FK in a table, than how to do that from phpmyadmin gui? thanks all
3 tables... Users: user_id (Pri, auto...) any_other_fields Subscriptions: subscription_id (Pri, auto...) any_other_fields UserSubscriptions: id (Pri, auto...) user_id subscription_id You can then add as many subscriptions as you want to the UserSubscriptions table. Use Innodb tables and put a foreign key from the UserSubscriptions.user_id to Users.user_id, and from UserSubscriptions.subscription_id to Subscriptions.subscription_id. This will keep accurate relationships between your tables.
thanks for all the replies..... one question i will repeat from my above question: If i am using a single Database in phpmyadmin than making an 'internal relations', using phpmyadmin user interface, between keys is same as making 'foreign keys' ? If not than how to make foreign keys from the phpmyadmin user interface? much thanks