ShoeLace1291 Posted September 7, 2010 Share Posted September 7, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/212792-forum-database-structure/ Share on other sites More sharing options...
Psycho Posted September 7, 2010 Share Posted September 7, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/212792-forum-database-structure/#findComment-1108408 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.