<?php
include("includes/db.php");

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

    $classTeacherQuery = "SELECT class_teacher FROM classes WHERE class_id = $classId";
    $classTeacherResult = $conn->query($classTeacherQuery);
    $classTeacher = $classTeacherResult->fetch_assoc()['class_teacher'];

    echo $classTeacher;
} else {
    echo "Error: Invalid request";
}
?>
