<?php
// config.php
$db_host = 'localhost';
$db_name = 'serv';
$db_user = 'root';
$db_pass = ''; // default wamp (adjust if you changed)
$site_root = __DIR__ . '/site_to_index'; // folder li fih pages dyalk (HTML/PHP)
try {
  $pdo = new PDO("mysql:host=$db_host;dbname=$db_name;charset=utf8mb4", $db_user, $db_pass, [
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
  ]);
} catch (Exception $e){
  http_response_code(500);
  echo "DB error: " . $e->getMessage();
  exit;
}