Jump to content

'users' table with 'child' accounts


theredwino

Recommended Posts

i'm working on a CMS project in PHP/MySQL that includes a 'users' table--a list of clients and their contact info.  Recently, the client i'm building this for asked me to include a feature wherein an 'executor' client profile could have 'child' accounts.  For instance, if a client wanted to place his wife and kids 'under his account', an admin could simply open his profile and drag and drop client names from the 'All Clients' list into a box on his profile.  This way, when his profile is opened, these accounts and their contact data, etc. would be listed below his.

 

Now, i know what i'm doing when it comes to building most of this.  In fact, most of it's already built.  My question is:  What is the best method for storing the 'child' account indexes in a MySQL field?  The client profile information is already there, stored in the 'users' table.  What [i think] i need to do is add a 'children' column to the 'users' table and populate it with the child client id's.  The problem is, i'm not sure what the best/most efficient field type is to use.  i was planning on using SET, but that doesn't work because any given 'executor' client could have anywhere from 1 to an indefinite number of 'child' accounts associated with it.  This seems (theoretically at least) to be a pretty easy problem to solve...i'm just not sure how.

 

If anybody has any advice for me, thank you very much in advance!

Link to comment
Share on other sites

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.