prepare(
"SELECT DISTINCT tf.Teacher_ID, tf.First_Name, tf.Last_Name
FROM teacher_profile tf
JOIN teacher_course_assignments tc ON tc.Teacher_ID = tf.Teacher_ID
WHERE tc.Program_ID = ?
ORDER BY tf.First_Name ASC"
);
if (!$stmt) {
die("Error preparing teacher query: " . $mysqli->error);
}
// Bind the Program_ID as an integer.
$stmt->bind_param("i", $Program_ID);
$stmt->execute();
$result = $stmt->get_result();
// Build the HTML option list for a