Mysql database design for Multi Level Marketing

how i should design database for Multi level Marketing ? where each user will be able to make two memeber under it and these two member will make  two-2 under themselve and so on...
abhishek2002Asked:
Who is Participating?
 
mherchlCommented:
table structure could be like this:

id_mem - primary key (autoincrement)
firstname
lastname
...
member_no - unique
id_master

using this structure, you can have 0+ members under selected member.

level 1 -----                         (id_mem, id_master) (1,null)
level 2 -----                              (2,1)     (3,1)
level 3 -----                   (4,2)   (6,2)      (5, 3),   (7,3)
... etc
0
 
ellandrdCommented:
well to start of with, in your main members table, each record will have a relationship with 2 records in another table and so on....

example:

tblExperts
-------------------------
member_id | member_name | member_title |
+++++++++++++++++++++++++++++++++++++++++
      1         |        ellandrd     |   expert         |
      2         |        expert1      |   expert         |
      3         |        expert2      |   expert         |

tblSeekers
-------------------------

seeker_id | seeker_name | seeker_title | member_id |
+++++++++++++++++++++++++++++++++++++++++
      1       | abhishek2002 |  seeker       |        1         |
      2       |    seeker2      |  seeker       |        1         |
      3       |     seeker3     |  seeker       |        2         |
      4       |     seeker4     |  seeker       |        2         |
      5       |     seeker5     |  seeker       |        3         |
      6       |     seeker6     |  seeker       |        3         |

tblMembers
-------------------------
member_id | member_name | member_title | seeker_id |
++++++++++++++++++++++++++++++++++++++++++++
        1       |    member1      |  member       |        1         |
        2       |   member2       |  member       |        1         |
        3       |   member3       |  member       |        2         |
        4       |   member4       |  member       |        2         |
   
and so on....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.