<?php
try {
    $pdo = new PDO('mysql:host=127.0.0.1;dbname=kenyan_pos', 'root', '');
    echo "Database connection successful!\n";
    
    // Test query
    $stmt = $pdo->query("SELECT 1 as test");
    $result = $stmt->fetch();
    echo "Test query result: " . $result['test'] . "\n";
    
} catch(Exception $e) {
    echo "Connection failed: " . $e->getMessage() . "\n";
}
?>