Jump to content

Forum Database Structure?


ShoeLace1291

Recommended Posts

I'm starting on a project of building a simple forum for my website.  My question is, what would be the best table structure for the database?  I've seen a couple different methods.  The simplest is a table for categories, forums, threads, and replies.  The only problem with that is that it makes it difficult to gather the thread update info for the forum list on the index.  You know, like "Latest thread posted by {USER_NAME} in {THREAD_NAME} at {THREAD_TIME}", that whole deal.  The second theory, which is what I'm thinking of using, is having tables for categories, forums, and messages(which would have a column for both messageid and threadid).  the only problem with that is that i'm not sure of how to distinguish the difference between a regular reply and a new thread.  Any ideas?

Link to comment
Share on other sites

The only problem with that is that it makes it difficult to gather the thread update info for the forum list on the index.  You know, like "Latest thread posted by {USER_NAME} in {THREAD_NAME} at {THREAD_TIME}", that whole deal.

 

Uh, not at all. You just need an appropriate query using the right JOIN/GROUP BY parameters.

 

Really, we cannot answer this question for you. It all depends upon exactly what features your forum will contain. Also, don't forget the user table!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.