looks some sort of tree type of relationship. a basic setup would be something like.
id int (autoincriment)
parent_id int
username varchar(20)
then, a root user (someone who joins alone?) has a parent_id of 0. then if a root user invited me to join, i would inherit a parent_id to the value of there id. then if i invite someone, they inherit my id as there parent_id. this way everyone is related.... well all the way back to the root user, and it can continue allong like this forever.
you could even extend this pretty easily to incorperate groups... but anyway.
hope this is clear, and maybe even close to what your after.