argan328 Posted March 2, 2007 Share Posted March 2, 2007 Hi all. Table design question: So far I have a general login table with username/password/email, etc. and a couple of other tables with the username as primary in order to link them. I need to give users a phonebook entry option to store phone numbers -- but here's what's holding me up: I need to also allow users to group phone numbers together in different ways. For example grouping phone numbers as Personal contacts, Business Contacts, Rotary Club contacts, etc. Do I need one table for each user? Or one table for each grouped phone list? I can't figure out how I would fit all those requirements into rows in one table. Thanks so much in advance! Any help I can get is much appreciated! Link to comment https://forums.phpfreaks.com/topic/40923-table-design-grouped-phone-list/ Share on other sites More sharing options...
effigy Posted March 2, 2007 Share Posted March 2, 2007 Assuming the user's create their own groups... User ========== id | name ---------- 1 | Bob 2 | Sally User_Phone_Group ======================= id | user_id | name ----------------------- 1 | 1 | Business 2 | 1 | Home 3 | 2 | Work 4 | 2 | Pals 5 | 1 | Pizza Phone =================================== id | user_phone_group_id | number ----------------------------------- 1 | 1 | 123-4567 2 | 1 | 234-5678 3 | 3 | 987-6543 4 | 5 | 765-4321 Link to comment https://forums.phpfreaks.com/topic/40923-table-design-grouped-phone-list/#findComment-198173 Share on other sites More sharing options...
argan328 Posted March 3, 2007 Author Share Posted March 3, 2007 that's beautiful! thanks! Link to comment https://forums.phpfreaks.com/topic/40923-table-design-grouped-phone-list/#findComment-198293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.