connect_error) { die("Connection failed: " . $conn->connect_error); } $memberId = $_SESSION['user_id']; // Get the member ID from session // SQL to fetch personal training sessions for the logged-in user $sql = "SELECT * FROM personal_training_session WHERE member_id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("i", $memberId); $stmt->execute(); $result = $stmt->get_result(); // Check if there are any sessions and display them if ($result->num_rows > 0) { echo "

Your Upcoming Personal Training Sessions

"; while($row = $result->fetch_assoc()) { echo "Session ID: " . $row["id"] . "
"; echo "Trainer: " . $row["trainer"] . "
"; echo "Start Time: " . $row["start_time"] . "
"; echo "End Time: " . $row["end_time"] . "

"; } } else { echo "No upcoming sessions found."; } $conn->close(); ?>