sjwspud Posted May 8, 2009 Share Posted May 8, 2009 Hi everyone! I am trying to figure something out, and hoping someone can help because this is really hurting my brain. I am writing my own forum system and I am trying to generate a jump list with a list of all forums and sub forums within each. I want to allow for unlimited levels of sub forums, but can't seem how to create the list. Maybe my database table configuration is wrong, or I just can't figure it out. Below is my database structure for the forums table: (database is MySQL if you need to know) forums (table name) id frm_s_order frm_hidden frm_cat_id - the category id the forum is assigned to. frm_frm_id - if the forum is a sub forum, than this contains the id of its parent forum. frm_is_sub - basically 0 if the forum is not a sub forum and 1 if it is a sub forum. frm_redirect frm_redirect_url frm_redirect_hits frm_archived frm_image frm_name frm_desc frm_total_replies frm_total_topics frm_lp_timestamp frm_lp_user frm_lp_tpc_id frm_prm_view frm_prm_post frm_prm_reply frm_prm_attach frm_prm_download frm_prm_edit frm_prm_delete frm_prm_poll frm_group_mods frm_user_mods frm_poll_enable frm_count_posts I think I forgot to mention the language I am attempting to do this in, I am trying to write this in PHP. I have been trying for hours to figure this out. All I want to do is create an option list of all forums and sub forums and sub forums within the subs, and within those subs, etc. If you have any suggestions on a format for the table to make this easier, or any examples of code that would complete this task I would appreciate it. I basically want to create a string list of <option></option> form information for each forum. Link to comment https://forums.phpfreaks.com/topic/157321-creating-a-forum-list-with-unlimited-sub-forum-levels/ Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 You don't really need is_sub. Link to comment https://forums.phpfreaks.com/topic/157321-creating-a-forum-list-with-unlimited-sub-forum-levels/#findComment-829200 Share on other sites More sharing options...
Mchl Posted May 8, 2009 Share Posted May 8, 2009 If you want to display all forums that would require multiple nested MySQL queries. Not a good thing. See presentations from this sticky http://www.phpfreaks.com/forums/index.php/topic,210842.0.html for some ideas on storing hierarchical data in database. Link to comment https://forums.phpfreaks.com/topic/157321-creating-a-forum-list-with-unlimited-sub-forum-levels/#findComment-829260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.