<?php
$servername = "localhost";
$username = "root";
$password = "";

// Connect to MySQL server (no DB selected yet)
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = file_get_contents('database_setup.sql');
if ($conn->multi_query($sql)) {
    echo "Database reset and setup successfully.\n";
    do {
        if ($result = $conn->store_result()) {
            $result->free();
        }
    } while ($conn->next_result());
} else {
    echo "Error setting up database: " . $conn->error;
}
$conn->close();
?>
