This is a simple blog system built with PHP and MySQL. The project features two main database tables: users and posts, which handle basic user and content management.
- User registration and login (authentication system)
- Creating and listing blog posts
- MySQL-based backend with
users,posts,mailsandcommentstables - Clean and minimal code structure
/c
/xampp
/htdocs
/blog
├── index.php
├── login.php
├── register.php
├── post.php
├── db.php
├── welcome.php
├── admin.php
├── style.css
...
// and the others
Note: The project does not include the actual
.sqldatabase export file.
You must manually create the required tables (users,postsandcomments) in your MySQL database.
- Clone the repository:
git clone https://github.com/HamzaGurbuz/TheBlog-
Import the database schema manually (see the next section).
-
Update the database connection info in config.php.
users table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
password VARCHAR(255) NOT NULL
);posts table
CREATE TABLE posts (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
title VARCHAR(255),
content TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);comments table
CREATE TABLE comments (
id INT AUTO_INCREMENT PRIMARY KEY,
post_id INT NOT NULL,
username VARCHAR(255),
comment TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);🚧 To-Do / Improvements Add password hashing ✔️
Improve UI with responsive design
Add comments functionality