Hello please i need a help on how to script a multilevel referal page. I want it to be that when a member (Eg. Mike) register, he is on level 1, when he refer someone(Eg. Nelson) he(Mike) should move to level 2 and Nelson in level 1. when Nelson refer another person(Eg. Clitton), Clitton should be in level one, Nelson should move to level 2 and Mike should move to level 3 automatically.
Regards.
how to script multilevel referal page
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to script multilevel referal page
- 1. Will every member receive a level up when a new person has been refered; or will it just be the person who does the refering and the person refered receiving +1 to their levels?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to script multilevel referal page
No, it is only the person that does the refering and those above him/her that will receive +1.
regards
regards
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to script multilevel referal page
I would then say select the person doing the refering (and everyone else above him/her) and just add + 1 to each of the respected levels. If there are already levels existing, they will have to be updated. If you are using a database (which is what my suggestion works on) you would have a SELECT query and an UPDATE query.No, it is only the person that does the refering and those above him/her that will receive +1.
Also, what would your database structure look like and how would the referer be tied together with the people above him / her? And if a person with a higher level referers someone, how will incrementing the levels work then? Example : Mike refers bob, bob is then 1 and Mike 4, what about Clitton and Nelson?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering