doddsey_65 Posted November 2, 2010 Share Posted November 2, 2010 Okay so I have 2 forums, which each have 1 topic and atleast 1 post within those topics lets call them forum 1 and forum 2 where the number is the id in the database under forum_id they are in a parent with a parent id of 1 so the database layout is forum_id - forum_parent_id 1 1 2 1 but i want to add a child board/subforum to forum_id 1. So i added two more columns forum_type f for forum or c for child board forum_connection the forum id this child is in(if its a child) but how would i get forum child with a forum_connection of 1 to appear under the forum with an id of one? here is my query: $query = $db->query("SELECT f.forum_id, f.forum_name, f.forum_description, f.forum_topics, f.forum_posts, f.forum_type, forum_connection, f.forum_last_poster, f.forum_last_post_time, f.forum_last_post, p.parent_id, p.parent_name, m.user_id, m.user_username, m.user_group, t.thread_topic_id, t.topic_name FROM forum_parents as p JOIN forum_forums as f ON f.parent_id = p.parent_id LEFT JOIN forum_members as m ON f.forum_last_poster = m.user_username LEFT JOIN forum_topics as t ON t.topic_name = f.forum_last_post WHERE f.forum_type = 'f' ORDER BY p.parent_id, f.forum_id ASC") or trigger_error("SQL", E_USER_ERROR); hopefully someone will understand this lol Quote Link to comment https://forums.phpfreaks.com/topic/217601-help-with-subforum-feature/ Share on other sites More sharing options...
fenway Posted November 7, 2010 Share Posted November 7, 2010 What do you have now? What do you want to be different? Quote Link to comment https://forums.phpfreaks.com/topic/217601-help-with-subforum-feature/#findComment-1131377 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.