多论坛数据库结构
最佳的多论坛数据库结构是什么? 我认为应该有一个表,其中包含论坛的名称和描述,另一个表包含帖子、帖子时间、撰写帖子的用户等,并将 forums
和 posts< /代码>表。 你觉得怎么样?这是一个好的决定吗?
表论坛
:
|fid|desc|title|
表帖子
|id|post|user|time|fid|
What is the optimal multiple forum db structure?
I think to have one table with the name and description of the forums and another with posts,time of the post,users which has written the post and etc. and to relate forums
and posts
table.
What do you think?Is this a good decision?
Table forums
:
|fid|desc|title|
Table posts
|id|post|user|time|fid|
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简而言之,是的。您几乎肯定希望将论坛和帖子分开,因为它们本质上是相关的,这也使您能够轻松地将帖子从一个论坛移动到另一个论坛,在那里它们可能更相关。
然而,您将需要更多的表格和字段来构建完整的论坛系统......
In short yes. You would almost certainly want to separate forums and posts as they are relational by nature and this also gives you the ability to easily move posts from one forum to another, where they may be more relevant.
You will need a lot more tables and fields for a complete forum system however...
这看起来是一个好的开始,尽管您缺少很多字段,更不用说大约 20 个其他表了
That looks like a good start although you're missing a lot of fields not to mention about 20 other tables
看起来不错。但我会重命名表“forums”的字段“desc”,因为它是保留字。
有关更多信息,请查看:
http://dev.mysql .com/doc/refman/5.5/en/reserved-words.html
Looks good. But i would rename the field `desc` of the table `forums` because it is a reserved word.
For more info have a look at:
http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html