prepare("SELECT * FROM favorite_locations WHERE user_id = ? ORDER BY city_name ASC"); $stmt->execute([$_SESSION['user_id']]); $favorite_locations = $stmt->fetchAll(PDO::FETCH_ASSOC); // Fetch all subscriptions for the user $stmt = $pdo->prepare("SELECT * FROM weather_subscriptions WHERE user_id = ?"); $stmt->execute([$_SESSION['user_id']]); $subscriptions = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { // Log error or handle it gracefully error_log("DB Error: " . $e->getMessage()); } } ?>