<?php
include 'connection/conn.php'; // Adjust as per your database connection

if(isset($_POST["course_id"])){
    $course_id = $_POST["course_id"];
    $query = "SELECT * FROM subjects WHERE course_id = '$course_id'";
    $result = mysqli_query($link, $query);
    echo '<option value="">Select Subject</option>';
    while($row = mysqli_fetch_assoc($result)){
        echo '<option value="'.$row['id'].'">'.$row['subject_name'].'</option>';
    }
}
?>
