I have a registration form where the user will enter a UID , SID and POS. i need to add users in a table structure like below, if a new user register with an id h , with a sponsor Id a and position L (left) how can i get the UID d.
UID SID UPID POS
a 0 0 0
b a a L
c a a R
d a b L
e b b R
f c c L
g c c R
UID= User ID
SID= Sponsor ID
UPID= Upline ID
POS= Position
[img]http://img59.imageshack.us/img59/2350/mlmo.jpg[/img]
also if possible can any 1 guide me i making a tree like structure.
[img]http://img40.imageshack.us/img40/9469/regisl.jpg[/img]