<?php
// Test database connection
require_once '../config/database.php';

try {
    $pdo = getDBConnection();
    echo "Database connection successful!<br>";
    
    // Test a simple query
    $result = $pdo->query("SELECT COUNT(*) as count FROM users");
    $count = $result->fetchColumn();
    echo "Total users: " . $count . "<br>";
    
    // Test appointments table
    $result = $pdo->query("SELECT COUNT(*) as count FROM appointments");
    $count = $result->fetchColumn();
    echo "Total appointments: " . $count . "<br>";
    
} catch (Exception $e) {
    echo "Database error: " . $e->getMessage();
}
?>
