Forum layout

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Forum layout

Post by pinehead18 »

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
User avatar
Jean-Yves
Forum Contributor
Posts: 148
Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK

Post by Jean-Yves »

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.
Post Reply