Forums

CLxyz

New member
For those of you who wrote their own forums, (Andrew275, a couple others come to mind), could you please elaborate on your table design?

Been planning one, just wanted some input on table structure before i start coding it
 
Well, while leaving out quite a few things, here: a general overview of how I've got mine setup. I imagine it's fairly similar to how others do it:

config
General configuration settings

groups
groupid (auto_increment primary key)
Stores settings and permissions for each user group.

users
userid (auto_increment primary key)
groupid - Points to the user's group
Other fields like username, password, email, etc. to store user information.

forums
forumid (auto_increment primary key)
name, description, etc. to store forum info

threads
threadid (auto_increment primary key)
forumid - Points to the forum that the thread is in
subject, iconid, etc. to store thread info

posts
postid (auto_increment primary key)
threadid - Points to the thread that the post is in
userid, message, subject, etc. to store information about the post


This is not even close to a complete list, but if you need more info about how to setup the tables, just ask.
 
Back
Top