I want to add a very simple blog feature on one of my existing LAMP sites. It will be tied to an existing user profile, and they will be able to simply enter the title and body for each post on their blog, and the date will be automatically set after sending. They will be allowed to edit and delete any blog post and title at any time. The blog will be displayed from the most recent to the oldest, perhaps 20 posts per page, with the correct pagination above this. Other users will be able to leave comments on each message that the blog owner will be allowed to delete, but not ahead of schedule. This is basically it. As I said, very simple.
How do I structure MySQL tables for this?
I assume that since there will be blog entries and comments, I need a separate table for each, is that correct? But what columns will I need in each table, what data structures should I use, and how do I link two tables together (for example, any foreign keys)?
I could not find any tutorials for something like that, and what I'm looking for really offers my users the simplest version of the blog. No tags, no notes, no images, no formatting, etc. Just a simple diary with clear text with comments from other users.
database mysql database-design blogs
Programmergirl
source share