Forums - One table or two?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Forums - One table or two?

Post by arpowers »

Hey guys,
quick question...
is it better to have one db table or two in your design of forums?

I can see advantages to both approaches..

Thanks
Andrew
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Huh? Forums generally have far more than two tables. A couple off the top of my head:

categories
forums
threads
posts
posts_text (possibly)

Why don't you try explaining your questions a bit better, and perhaps describe these "advantages" of using one or two tables?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

When designing my forums, I had (besides the users table)

forums
forumtopics
forumentries

And I wish I would have had a forumentries_text table, to store the raw post data. I eventually got a solid way to reverse my custom bbcode, but it was a hassle to figure out.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
yanglei1979
Forum Commoner
Posts: 38
Joined: Sat Aug 25, 2007 10:21 pm

Post by yanglei1979 »

Two tables

threads and replies
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Post by arpowers »

Thanks for the replies...

sorry I should have clarified, but what I was looking for was the 'threads and replies' ...

I wasn't thinking about the table for forums and categories

thanks again.>.
Andrew
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I'm curious to know what advantages you see between using a single table and multiple tables?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

One table is certainly possible. Might not be a bad idea for your first iteration see whats slow, if anything. I say go for it!
Post Reply