How to generate a tree view from this result set based on Tree Traversal Algorithm?
问题 I have this table: CREATE TABLE `categories` ( `id` int(11) NOT NULL auto_increment, `category_id` int(11) default NULL, `root_id` int(11) default NULL, `name` varchar(100) collate utf8_unicode_ci NOT NULL, `lft` int(11) NOT NULL, `rht` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_id` (`category_id`), KEY `lft` (`lft`,`rht`), KEY `root_id` (`root_id`) ) Based on this question: Getting a modified preorder tree traversal model (nested set) into a <ul> The difference is that I have many