prepare(" SELECT r.*, AVG(rt.rating) as rating, COUNT(rt.id) as rating_count FROM restaurants r LEFT JOIN ratings rt ON r.id = rt.restaurant_id WHERE r.id = ? GROUP BY r.id "); $restaurant_stmt->execute([$restaurant_id]); $restaurant = $restaurant_stmt->fetch(PDO::FETCH_ASSOC); // If restaurant not found, redirect if (!$restaurant) { header('Location: index.php'); exit(); } // Fetch menu items for the specific restaurant $menu_items_stmt = $pdo->prepare("SELECT * FROM menu_items WHERE restaurant_id = ? ORDER BY name"); $menu_items_stmt->execute([$restaurant_id]); $menu_items = $menu_items_stmt->fetchAll(PDO::FETCH_ASSOC); include 'header.php'; ?>

0): ?>
( ratings)
No ratings yet

Menu