 
<?php
// db.php

$host = 'localhost';
$db   = 'hotel_booking_system';
$user = 'root'; // change if using a different DB user
$pass = '';     // change if there's a password

try {
    $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8", $user, $pass);
    // Enable PDO error mode
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Database connection failed: " . $e->getMessage());
}
?>
