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
https://forums.phpfreaks.com/topic/212792-forum-database-structure/
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!

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.