mysql数据库中的论坛数据 [英] Forum data in mysql database
问题描述
所以我使用 php 为学校项目制作了一个简单的网站.
So I am using php to make a simple website for a school project.
对于论坛,我会这样做吗?
For a forum would I do this?
创建新区域时 > 创建新数据库当一个区域中的新主题被创建时 > 创建一个新表创建主题中的新帖子时 > 向表中添加行
When a new area is created > create a new database When a new topic in an area is created > create a new table When a new post in a topic is created > add row to table
当一个区域被删除时 > 删除数据库删除主题时 > 删除表格
When a area is deleted > delete the database When a topic is deleted > delete the table
等等等等
这会是您为论坛类型场景做的事情吗?
Would this be what you do for a forum type scenario?
推荐答案
启动项目后不要添加表或数据库.设置不需要新表而只需要新条目的设计.
You don't add tables or databases after you launched your project. Set up a design that does not need new tables but only new entries.
你可以这样做
areas (id, name)
topics (id, area_id, name)
posts (id, topic_id, title, content)
这篇关于mysql数据库中的论坛数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!