<?php
include "connection.php";
header("Content-Type: application/json");

$course_id = $_GET['course_id'] ?? 0;
$rs = Database::search("SELECT * FROM `subject` WHERE course_id = '$course_id'");
$data = [];

while ($row = $rs->fetch_assoc()) {
    $data[] = $row;
}

echo json_encode(["status" => true, "data" => $data]);
?>
