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

try {
    echo "<h3>Testing Database...</h3>";

    // Check DB name
    $stmt = $pdo->query("SELECT DATABASE()");
    $dbName = $stmt->fetchColumn();

    echo "Connected to DB: <b>$dbName</b><br>";

    // Check if users table exists
    $stmt = $pdo->query("SELECT COUNT(*) FROM users");
    $count = $stmt->fetchColumn();

    echo "Users table OK. Total users: <b>$count</b><br>";

    echo "<br>✅ This is your ACTIVE database.";

} catch (PDOException $e) {
    echo "❌ Error: " . $e->getMessage();
}
?>