gpt4 book ai didi

php - 数据库设计: best practice for designing a forum table

转载 作者:可可西里 更新时间:2023-11-01 06:56:32 25 4
gpt4 key购买 nike

<分区>

不知道在设计论坛的时候有没有什么实践。我想设计几个论坛。是的,至少有两种不同类型的论坛。一个供选择性成员使用,另一个对所有公共(public)成员开放。

在论坛中,成员(member)可以发起话题,其他成员(member)可以回复。

所以我对这类论坛的结构有一个大概的想法。

我将论坛表命名为“字符串”表。这是我能想到的结构,

str_id        for the auto increment id
str_tilte for title of the thread
str_content for content/ text of the thread
str_follow for you to choose whether you want to follow this thread or not
str_approved for the admin to approve or reject the thread
parent_id*1
mem_id member id who initiates the thread or who responds to the op
cat_id*2
str_created
str_updated

*1 例如。如果数据注入(inject)是一个 op 线程那么父 id 就是它自己,如果注入(inject)是对 op 的响应,它的父 id 就是 op 的 str_id。

*2 这一列是存放当前数据注入(inject)的类别id。如果注入(inject)是选择性论坛则为 1,如果注入(inject)是公共(public)论坛则为 2。

不确定我是否在最佳轨道上,但如果您有更好的想法,请告诉我。

谢谢。

编辑:

感谢使用phpbb的一些回复和建议。

刚刚看了一下并下载了 phpbb。我有 101% 的把握不会去争取它。它是一个完整的程序,如 Wordpress 或任何其他 PHP 框架(如 Zend)。我有一个独立的框架运行这个网站,所以我不想运行另一个程序/框架来搞乱网站的后端结构等。

如果我的网站只是一个纯粹的论坛网站,那么也许我会考虑 phpbb。但论坛只是我当前项目中整体网站的一个子功能。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com