<?php
ini_set('display_errors','1'); error_reporting(E_ALL);
require_once __DIR__.'/../includes/auth.php'; // سيحمّل db.php عبر auth.php
echo "<p>auth.php loaded OK.</p>";

try {
  $pdo = db();
  echo "<p>DB: OK — user: <b>".htmlspecialchars($pdo->query('select user()')->fetchColumn())."</b></p>";
} catch (Throwable $e) {
  echo "<p style='color:red'>DB ERROR: ".htmlspecialchars($e->getMessage())."</p>";
}
