Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. $first_level = mysql_query("SELECT id, email FROM $db[users] WHERE parent_uid='$uid'");
  2. while($f = mysql_fetch_array($first_level)) {
  3. echo "Level 1: $f[id] $f[email]<BR>";
  4. $second_level = mysql_query("SELECT id,email FROM $db[users] WHERE parent_uid='$f[id]'");
  5. while($s = mysql_fetch_array($second_level)) {
  6. echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level 2: $s[id] $s[email]<BR>";
  7. $third_level = mysql_query("SELECT id, email FROM $db[users] WHERE parent_uid='$s[id]'");
  8. while($t = mysql_fetch_array($third_level)) {
  9. echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level 3: $t[id] $t[email]<BR>";
  10. }
  11. }
  12.  
  13. echo "------------<BR>";
  14. }
  15.  
  16.  
  17. Output:
  18.  
  19. Level 1: 4005 fk1wa8j2us@test.dailyclassifieds.com
  20. ------------
  21. Level 1: 4004 hu5v2v8cgq@test.dailyclassifieds.com
  22. Level 2: 4002 xl6ez99by3@test.dailyclassifieds.com
  23. Level 3: 4000 xe4leuarcp@test.dailyclassifieds.com
  24. Level 3: 3999 t8kyd8qc82@test.dailyclassifieds.com
  25. Level 3: 3998 nca1vag4fs@test.dailyclassifieds.com
  26. Level 3: 3997 9z6849wukk@test.dailyclassifieds.com
  27. Level 2: 4001 216pscfx1z@test.dailyclassifieds.com
  28. ------------
  29. Level 1: 4003 twrw4q5y41@test.dailyclassifieds.com
  30. ------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement