QA


Q&A

Q

What if I want multiple forums? This sequence assumes there is only one forum available.

A

If you want to have multiple forums in your discussion board, then create a table called forums (or something to that effect) containing fields for an ID, name, and perhaps a forum description. Then, in the forum_topics and forum_posts tables, add a field called forum_id so that these elements lower in the hierarchy are tied to the master forum. Be sure to amend the SQL queries for record insertion, to account for the value of the forum_id.

Next, instead of starting your display at the topic level, begin it at the forum level. Just as you created a script to display topics, create a script to show the forums. The link to the forum display would contain the forum_id, and the page itself would show all the topics within that forum.



Sams Teach Yourself PHP MySQL and Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (4th Edition)
ISBN: 067232976X
EAN: 2147483647
Year: 2003
Pages: 333
Authors: Julie Meloni

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net