Codexxx Posted September 10, 2008 Share Posted September 10, 2008 ok my forum layout is like this Category -> topics -> thread When i list the categories (frontpage of forum) i want to be able to list the total posts within the topics for that category. However this requires the id from the category to be written to the threads database. THis id within the link is lost when the topic link is clicked.. my aim is to somehow get the id from category when they post a reply in thread.. so when i want to get total posts for that category i can query the threads db with the category id...... (so i can num rows showing total posts) Many forum links are set up the same way, im just unsure how they do it i could do by setting sessions to save the id when they click the category to view, so by chance they post a reply the id is saved in session, just i dont wanna have huge arse phpsessid links hehe any thoughts? or sessions are the way? cheers Link to comment https://forums.phpfreaks.com/topic/123540-solved-forum-design-question-to-get-total-posts-within-category/ Share on other sites More sharing options...
vicodin Posted September 10, 2008 Share Posted September 10, 2008 Its all in the DB... Lets say someone makes a post. When that post is stored in the db it should have log the category its in and the topic its in (every category,topic and post should have a unique identifier)... So when you do a query have it count where parent_id = "What ever your parent ID is." Do you get it? Link to comment https://forums.phpfreaks.com/topic/123540-solved-forum-design-question-to-get-total-posts-within-category/#findComment-638067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.