I'm writing a mini forum and just need a little advice.
I have a forum table (the main forums) then a viewtopic.php page with lists the topics and the description that peopel post under them. and then the threads.
Do i need a topic table and a thread table? or should i make those one?
Thank you
Anthony
Forum layout
Moderator: General Moderators
Yes -
eg: Forums table has 1-to-many related records in Topics table which in turn has a 1-to-many related records in Threads.
You'll probably want to have a Thread_Answers table too, to normalise the answers (otherwise they'll all have the Thread heading field needlessly repeated) - if I've understood you're hierarchy correctly.
Basically - if' you are repeating information other than foreign keys, then consider creating a new table and relationship below the current level.
eg: Forums table has 1-to-many related records in Topics table which in turn has a 1-to-many related records in Threads.
You'll probably want to have a Thread_Answers table too, to normalise the answers (otherwise they'll all have the Thread heading field needlessly repeated) - if I've understood you're hierarchy correctly.
Basically - if' you are repeating information other than foreign keys, then consider creating a new table and relationship below the current level.