多论坛数据库结构

发布于 2024-10-20 23:03:47 字数 288 浏览 2 评论 0原文

最佳的多论坛数据库结构是什么? 我认为应该有一个表,其中包含论坛的名称和描述,另一个表包含帖子、帖子时间、撰写帖子的用户等,并将 forumsposts< /代码>表。 你觉得怎么样?这是一个好的决定吗?

论坛

|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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蹲墙角沉默 2024-10-27 23:03:47

简而言之,是的。您几乎肯定希望将论坛和帖子分开,因为它们本质上是相关的,这也使您能够轻松地将帖子从一个论坛移动到另一个论坛,在那里它们可能更相关。

然而,您将需要更多的表格和字段来构建完整的论坛系统......

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

狼亦尘 2024-10-27 23:03:47

这看起来是一个好的开始,尽管您缺少很多字段,更不用说大约 20 个其他表了

That looks like a good start although you're missing a lot of fields not to mention about 20 other tables

计㈡愣 2024-10-27 23:03:47

看起来不错。但我会重命名表“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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文