How to create a user referral tree from a database
Are you thinking of a referral program? Referral Program