Build dynamic menu using Nested Sets
问题 I am trying to build a dynamic menu in my PHP CMS; the pages/categories are organized using the nested sets model. Full tree: root A B B1 B1.1 B1.2 B2 B2.1 B2.1 C C1 C2 C3 D I want to convert this result set to an unordererd list, which only displays a part of the tree. For example: If I click on B, I want to show only the following part of the list: A B B1 B2 C D Next, if I click on B1 I want the to show this list: A B B1 B1.1 B1.2 B2 C D etc. I use the following SQL query to get all nodes