esport Posted April 1, 2008 Share Posted April 1, 2008 Hi guys, I want to display hierarchically organized data in the form of categories/subcategories. The classic usage is in products, where the db tree is used to filter data based on the active subcategory. I have a table called categories with the following fields: id, parent_id, name I have the following example data 1,0,trade 2,0,house 3,1,painting 4,1,electrical So if I passed the id 3, it would display: trade > electrical Can anyone help? Thanks Daniel Link to comment https://forums.phpfreaks.com/topic/98973-subcategories/ Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 Theres a great tutorial here. Link to comment https://forums.phpfreaks.com/topic/98973-subcategories/#findComment-506430 Share on other sites More sharing options...
esport Posted April 1, 2008 Author Share Posted April 1, 2008 Thanks for the tutorial, it helped greatly. Link to comment https://forums.phpfreaks.com/topic/98973-subcategories/#findComment-506495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.