<?php
$config = require 'config/config.php';

try {
    $pdo = new PDO(
        'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['name'],
        $config['db']['user'],
        $config['db']['pass']
    );
    echo "✅ Database connection SUCCESS!";
    
    // Test if users table exists
    $stmt = $pdo->query("SELECT COUNT(*) FROM users");
    $count = $stmt->fetchColumn();
    echo "<br>✅ Users table exists. Row count: " . $count;
    
} catch (Exception $e) {
    echo "❌ Database connection FAILED: " . $e->getMessage();
}
?>