PHP Syntax (Toggle Plain Text)
1. function GetDownline($member_id,$direction)
2. {
3. $getdownlinesql = @mysql_fetch_assoc(@mysql_query('select memberid,placementid,position from `yourrelationaltable` where placementid="'.$member_id.'" and position="'.$direction.'"'));
4. $getdownline = $getdownlinesql;
5. return $getdownline;
6. }
7. then simply call it with:
8. $firstleft = GetDownline('headmemberidhere','Left'); //for first left
9. $firstright = GetDownline('headmemberidhere','Right'); //for first right
10. echo $firstleft;
11. echo $firstright;