Jump to content

[SOLVED] advice in table decision...


DanDaBeginner

Recommended Posts

:) 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

Link to comment
https://forums.phpfreaks.com/topic/45252-solved-advice-in-table-decision/
Share on other sites

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.