prepare("INSERT INTO students (student_code, name_th, name_en, email, faculty, graduated_institution, curriculum_id, enrollment_year, advisor_id, previous_qualification) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([$student_code, $name_th, $name_en, $email, $faculty, $graduated_institution, $curriculum_id, $enrollment_year, $advisor_id, $previous_qualification ?: null]); $message = 'เพิ่มนักศึกษาสำเร็จ'; echo ""; exit; } catch (PDOException $e) { if ($e->getCode() == 23000) { $error = 'รหัสนักศึกษานี้มีอยู่ในระบบแล้ว'; } else { $error = 'เกิดข้อผิดพลาด: ' . $e->getMessage(); } } } } ?>

เพิ่มนักศึกษาใหม่

กลับ