开发者

unlimited categories/subcategories with MYSQL

I'm trying to build a category/subcategory class with php & MySQL.

I am stuck with the following problem:

I want to make a selection of all categories in an ordered way like it's showed in the picture below. The table structure I've made is:

unlimited categories/subcategories with MYSQL

开发者_如何学C

Can I build an SELECT * statement which will select these categories in that order?


You need to index your tree. There are multiple means to do so, explained in Managing Hierarchical Data in MySQL.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜