Answer the question
In order to leave comments, you need to log in
How to draw a multi-level menu with an array sorted by the left key nested sets?
There is a table nested sets (id, name, lef_key, right_key, level), I pull out a tree from the database with a query:
Then I form an array of objects in a loop:'SELECT * FROM my_tree ORDER BY left_key'
while($row=$sth->fetchObject()){
$tree[]=$row;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question