开发者

unlimited categories/subcategories with MYSQL

开发者 https://www.devze.com 2023-03-12 03:56 出处:网络
I\'m trying to build a category/subcategory class with php & MySQL. I am stuck with the following problem:

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

精彩评论

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

关注公众号