<?php
include('connection.php');

if (isset($_GET['group'])) {
    $selectedGroup = $_GET['group'];
    $sql2 = "SELECT member FROM groups_table WHERE group_name = '$selectedGroup'";
    $res2 = mysqli_query($conn, $sql2);

    if ($res2) {
        while ($row = mysqli_fetch_assoc($res2)) {
            echo $row['member'] . "<br>";
        }
    } else {
        echo "Error fetching members.";
    }
}
?>