Forum data in mysql database

断了今生、忘了曾经 提交于 2019-12-11 11:18:53

问题


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

etc etc.

Would this be what you do for a forum type scenario?


回答1:


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.

You could do something like this

areas (id, name)
topics (id, area_id, name)
posts (id, topic_id, title, content)



回答2:


Your database schema should be pretty much locked in for your normal website operations. You would have a single database, a table for forums, a table for posts, a table for users, etc.

If you search, there are tutorials out there to help get you started. I just found this one: Creating a simple PHP forum tutorial.



来源:https://stackoverflow.com/questions/12738292/forum-data-in-mysql-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!