DanDaBeginner Posted April 2, 2007 Share Posted April 2, 2007 I am in the middle of making a decision on my dbase structure..I am going to develop a site the same as this site, a forum, which will tuckle about the crisis of one country...now my question is, for example in this forum, they have a topic name: mysql help, php help, HTML help, ORACLE, PHP freelancing, etc... now back to my question, would be best if im going to have a table for each forum?like mysqlhelp_table, phphelp_table, etc.. or an insanity? I thought about having 1 table that has a field name "forum_about" that can contain ORACLE, PHP help, etc... but im concern about the speed? would it be slow if I use 1 table or multiple table? wha is the best? Dan thanx Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 2, 2007 Share Posted April 2, 2007 You need to download something like SMF, phpBB, vBulletin or other forum software and thoroughly examine the table structure. It would be insanity to manage a DB structure where you have to insert a new table for each forum. Typically, you'll have a table to hold the forums, another to hold the individual topics and yet another to hold all the posts. These will be referenced to each other and some simple joins will allow you to query and display everything as you will. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted April 2, 2007 Author Share Posted April 2, 2007 thanx for the advice.. you gave me an idea... 1 table for the parent forum, 1 table for the reply/child forum.. how was that? what do you mean by individual topics? Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 2, 2007 Share Posted April 2, 2007 If you go to the main page of this forum, you'll see a forum labeled "MySQL and PHP Forums" or something similar. Within that, you'll see a topic titled "PHP Help," and then there are a ton of individual threads within that topic. Each thread then has multiple posts. Each level of a hierarchy like this really needs to be stored separately with references between them. A well optimized table with clean references is actually going to be faster to query than one that appears simpler because of fewer tables but actually has a much larger data duplication rate. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted April 2, 2007 Author Share Posted April 2, 2007 thanx for the wonderful advice.. I got it now... just need to layout my dbase and post here for checking.. thanx again.. 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.