<?php
include 'includes/db.php';

$sql = "CREATE TABLE IF NOT EXISTS blogs (
    id INT(11) NOT NULL AUTO_INCREMENT,
    title VARCHAR(255) NOT NULL,
    content TEXT NOT NULL,
    image_url VARCHAR(255) DEFAULT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
)";

if ($conn->query($sql) === TRUE) {
    echo "Table 'blogs' created successfully";
} else {
    echo "Error creating table: " . $conn->error;
}

$conn->close();
?>
