Jump to content

Recommended Posts

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.

;D

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.