Jump to content

threaded forums


mike1313

Recommended Posts

Have a topics table and a posts table. Use a has-many relationship to link the posts to a topic by having a column called topic_id in posts.

 

Then you could do this to get all the posts in topic id 5:

SELECT * FROM posts WHERE topic_id = 5;

 

I'd also put the first post in the posts table as well instead of a column called body in topics or something like that.

Link to comment
https://forums.phpfreaks.com/topic/83176-threaded-forums/#findComment-423092
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.