prepare("SELECT * FROM restaurants WHERE id = :id"); $stmt->execute(['id' => $id]); $restaurant = $stmt->fetch(); if (!$restaurant) { echo "Restaurant not found."; exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $name = $_POST['name']; $google_map_link = $_POST['google_map_link']; $menu_link = $_POST['menu_link']; $cost_category = $_POST['cost_category']; $food_type = $_POST['food_type']; $food_type_subcategory = $_POST['food_type_subcategory']; $stmt = $pdo->prepare(" UPDATE restaurants SET name = :name, google_map_link = :google_map_link, menu_link = :menu_link, cost_category = :cost_category, food_type = :food_type, food_type_subcategory = :food_type_subcategory WHERE id = :id "); $stmt->execute([ 'name' => $name, 'google_map_link' => $google_map_link, 'menu_link' => $menu_link, 'cost_category' => $cost_category, 'food_type' => $food_type, 'food_type_subcategory' => $food_type_subcategory, 'id' => $id, ]); header('Location: manage.php'); exit; } ?>