<?php
$host = 'localhost';
$user = 'root';
$pass = '';

try {
    $pdo = new PDO("mysql:host=$host", $user, $pass);
    $stmt = $pdo->query("SHOW DATABASES");
    $databases = $stmt->fetchAll(PDO::FETCH_COLUMN);
    echo "Databases found: " . implode(', ', $databases);
} catch (PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}
?>
