If I have a table like this in MYSQL where category_parent_id = 0 if it is at top level:
How I do I display tree view like this by using php:
>>clothes
>>>>shirt
>>>>tie
>>>>trousers
>>food
>>>>indianfood
>>>>chinesefood
>>>>spanishfood
I am able to display links to every single one of them, but i dont know how to display them in tree hierachy view with proper indent to each different level. Any hints for me??? Thanks
Managing Hierarchy
Moderator: General Moderators
Re: Managing Hierarchy
Here is a link to a good article on traversing a tree. I use the modified preorder tree traversal algorithm for the menu on my software.
http://www.sitepoint.com/article/hierar ... a-database
You should be able to figure things out from there. They even give some sample PHP code.
http://www.sitepoint.com/article/hierar ... a-database
You should be able to figure things out from there. They even give some sample PHP code.
Re: Managing Hierarchy
Hey Thanks. I will try to figure it out .. 