<?php

require_once __DIR__ . '/db.php';

try {
    $pdo = db();

    $result = $pdo->query("SELECT NOW() AS db_time")->fetch();

    echo "MYSQL CONNECTION: OK<br>";
    echo "DB TIME: " . htmlspecialchars($result['db_time']);

} catch (Throwable $e) {

    http_response_code(500);

    echo "MYSQL CONNECTION: ERROR<br>";
    echo htmlspecialchars($e->getMessage());
}