<?php function display_tree($root) { // retrieve the left and right value of the $root node 'WHERE title=\"'.$root.'\";'); // start with an empty $right stack // now, retrieve all descendants of the $root node 'WHERE lft BETWEEN '.$row['lft'].' AND '. $row['rgt'].' ORDER BY lft ASC;'); // display each row // only check stack if there is one // check if we should remove a node from the stack } } // display indented node title // add this node to the stack $right[] = $row['rgt']; } } ?>
Podaje ID rodzica np Food i chce zeby wyświetliło mi ostatnie liście czyli Cheery, Banana, Beef, Pork
Siedze przy tym juz pare godzin i nie moge wpaść na pomysł, kto może ma?