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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.