让我们假设我有一个这样的表:
-> id | parent_id | name
-> 1 | 0 | Food
-> 2 | 1 | Salty
-> 3 | 1 | Sweet
-> 4 | 2 | Patty
-> 5 | 4 | Meat
-> 6 | 3 | Cupcake
-> 7 | 5 | Made on Oven
-> 8 | 5 | Fried
-> 9 | 6 | Chocolate
我想知道我必须在PHP中使用什么样的巫术才能获得有序的结果 dinamically而不知道列表将具有这样的子级别:
Food
- Salty
- - Patty
- - - Meat
- - - - Made on Oven
- - - - Fried
- Sweet
- - Cupcake
- - - Chocolate
谢谢!