prepare(" SELECT r.id, r.name, r.cuisine, r.address FROM restaurants r JOIN favorite_restaurants fr ON r.id = fr.restaurant_id WHERE fr.user_id = ? ORDER BY r.name ASC "); $stmt->execute([$user_id]); $favorite_restaurants = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { error_log("Database error fetching favorites: " . $e->getMessage()); // Optionally, show a friendly error to the user } ?>
You haven't added any favorite restaurants yet.
= htmlspecialchars($restaurant['cuisine']) ?>
= htmlspecialchars($restaurant['address']) ?>
View Menu