obarlas

Iterate Function

May 10th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. function iterate($what, $depth = 0) {
  2.   // $DB = new mysqli("localhost","user","password");
  3.  
  4.   $ga = $DB->query("SELECT * FROM Depo__Kategoriler WHERE Sahip = '".$what."' ORDER BY Aciklama");
  5.   for ($a = 0; $a < $ga->num_rows; $a++) {
  6.     $aa = $DB->vars($ga,$a);
  7.     echo str_repeat(".", $depth).$aa["Aciklama"]."<br />\n";
  8.     iterate($aa["Id"], $depth + 1);
  9.   }
  10. }
  11. iterate(0,0);
Advertisement
Add Comment
Please, Sign In to add comment