且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用PHP MySQL的类别层次结构(按顺序)

更新时间:2023-11-30 12:03:40

您要使用SQL遍历树吗?对于邻接列表模型,这是不可能的,您必须使用嵌套集模型.然后您可以ORDER BY left以正确的顺序获取整棵树.

You want to traverse the tree using SQL? That is not possible with the adjacency list model, you have to use the nested sets model. Then you can just ORDER BY left to get the whole tree in the correct order.