Reputation: 20587
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?
Upvotes: 1
Views: 2064
Reputation: 17477
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.
Upvotes: 1
Reputation: 204914
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)
Upvotes: 3