Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Mysql database design for Multi Level Marketing

Posted on 2006-05-01
4
Medium Priority
?
4,820 Views
Last Modified: 2006-11-18
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...
0
Comment
Question by:abhishek2002
2 Comments
 
LVL 14

Accepted Solution

by:
mherchl earned 500 total points
ID: 16585252
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
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 500 total points
ID: 16656194
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question