<?php
$conn = mysqli_connect('localhost', 'root', '');
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

// Try to create database if it doesn't exist
$sql = "CREATE DATABASE IF NOT EXISTS real_estate_db";
if (mysqli_query($conn, $sql)) {
    echo "Database checked/created successfully";
} else {
    echo "Error creating database: " . mysqli_error($conn);
}

mysqli_close($conn);
?>
