<?php
include('includes/dbconnection.php');

if (isset($_POST['class_name'])) {
    $class_name = $_POST['class_name'];

    // Fetch section with ID (class_section.id)
    $sections_result = $con->query("SELECT id, section FROM class_section WHERE class = '$class_name'");

    echo '<option value="">Select Arm</option>';
    while ($row = $sections_result->fetch_assoc()) {
        echo '<option value="' . $row['id'] . '" data-section="' . $row['section'] . '">' . $row['section'] . '</option>';
    }
}
