SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to make a multi level referral system in php

    Hello,

    I want to make multi level referral system in that if A,B, C,D,E are registered user of a site then B is referred by A and C is referred by C and so on. In my site there is system for earning incentive. I want to show how much money A has earned through B and B through C and likewise.

    I want simply show referrals name and their number in A's profile and portion of money earned from each referral.


    i have downloaded a script from this site. The demo is here:http://scripts.kunals.com/index.php?.../index&itmid=1

    And i have two types of users in my site: normal user and premium user. I want to generate ref id only for premium users. what will be the table structure?

  2. #2
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very sad to see that no replies till now...if anybody have some idea please share with me.

  3. #3
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    514
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vny.009 View Post
    very sad to see that no replies till now...if anybody have some idea please share with me.
    This not a php problem but a relational database problem, how one user is related to other users. Assuming that each user is referred by only one user you just need a "referred_by_id" field and a good use of MySQL queries should return all the results you need.

    This thread might get better answers at the database board.
    Denny Schlesinger
    web services

  4. #4
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by captainccs View Post
    This not a php problem but a relational database problem, how one user is related to other users. Assuming that each user is referred by only one user you just need a "referred_by_id" field and a good use of MySQL queries should return all the results you need.

    This thread might get better answers at the database board.

    thanks for your reply. I asked here because i have a script and today i made another script which comprises several nested while loop. Now question is that using several nested loop can be safe i mean no problem on server speed if more users visit that page.
    Because this would be used on social networking site.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •