hi i have a table with structure and records given below. The records will store like i have shown in the table. During a new user Registration i am asking for UID , Sid (sponsor id) and Pos(position).
Suppose a user 9 wants with sponsor id 1 (upid 8) on left as position wants to join how will i get 8 as the sponsor id.
http://www.freeimagehosting.net/uploads/ea5d52a3f3.jpg