<?php
$host = 'localhost';
$user = 'root';
$pass = '';

$conn = new mysqli($host, $user, $pass);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Try to create new database
$new_db = 'ci_news_new';
if ($conn->query("CREATE DATABASE IF NOT EXISTS `$new_db`")) {
    echo "Database `$new_db` created successfully or already exists.\n";
} else {
    echo "Error creating database: " . $conn->error . "\n";
}

$conn->close();
echo "Done.\n";
