Search code examples
phpmysqlforum

Forum data in mysql database


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?


Solution

  • 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)