如何在发布应用程序时有多个回复?

bea*_*ear 1 php mysqli database-design

这是一个简单的问题.

使用PHP和MySQL,我正在尝试构建一个错误报告应用程序.

目前,用户可以发布错误,并且向技术人员/管理员描绘错误列表.

如何制作,以便许多技术人员或管理员可以回复报告(线程?)

如同mysql表格布局和PHP编码一样?

当前MySQL表的布局为:

id          (Bug ID)
by          (person reporting it)
title       (Report Title)
content     (Contents of Report)
datetime    (Date/Time of report)
application (Application/page where problems happens)
priority    (Priority)
assigned    (Assigned To)
status      (Status of report/bug)
Run Code Online (Sandbox Code Playgroud)

所以还没有响应列,但是如何使用PHP和MySQLi实现多个帖子/响应?

谢谢

Cad*_*oux 5

这将是一对多的关系.你可以有:

响应表

id (response id)
bugid (bug id)
columns related to the response
Run Code Online (Sandbox Code Playgroud)

要么

响应表

id (response id)
columns related to the response
Run Code Online (Sandbox Code Playgroud)

bugresponse表

responseid (response id)
bugid (bug id)
columns related to the bug-response relationship
Run Code Online (Sandbox Code Playgroud)

第二种设计也可以处理多对多关系(在这种情况下可能不太必要),并且根据您的要求也可以有其他一些好处.