iShaun Posted September 19, 2008 Share Posted September 19, 2008 Im making some forums software, and what i have is a table called "forums". There is a field called "parent_id" and if it is 0, its a category, if not, its a forum. If I am viewing a forum, how would I loop through parent_id's until I get to one set to 0 (a category). I am doing this for the Your Location: Forum Title > Forum Name > Topic Name thing. Help please? Link to comment https://forums.phpfreaks.com/topic/124880-php-question/ Share on other sites More sharing options...
Guest Xanza Posted September 19, 2008 Share Posted September 19, 2008 Well you should read up a little on forum creation. Most typically the hierarchy goes like this: Forum Category (Top Level) -Forum --Sub Forum --(Sub Forum Topics) (Topics) Forum Category Link to comment https://forums.phpfreaks.com/topic/124880-php-question/#findComment-645317 Share on other sites More sharing options...
GingerRobot Posted September 19, 2008 Share Posted September 19, 2008 You might want to take a look through this article on the MySQL website: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Link to comment https://forums.phpfreaks.com/topic/124880-php-question/#findComment-645445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.