<?php
class Database {
    private $host = 'localhost';
    private $db_name = 'restaurant_demo';
    private $username = 'root';
    private $password = 'Qrty123@';
    public $conn;

    public function connect() {
        $this->conn = null;
        try {
            $this->conn = new PDO(
                "mysql:host={$this->host};dbname={$this->db_name};charset=utf8mb4",
                $this->username,
                $this->password,
                [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
            );
        } catch (PDOException $e) {
            die('Database connection failed: ' . $e->getMessage());
        }
        return $this->conn;
    }
}?>