<?php
/**
 * Reset Database Script - Drops and recreates the database
 */

$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '';

try {
    $pdo = new PDO("mysql:host=$dbHost", $dbUser, $dbPass);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    
    // Drop database if exists
    $pdo->exec("DROP DATABASE IF EXISTS rorschach_co");
    echo "Database dropped successfully!<br>";
    
    // Run setup
    echo "Running setup...<br>";
} catch (PDOException $e) {
    die("Error: " . $e->getMessage());
}
?>
<script>
window.location.href = 'setup_database.php';
</script>
