if (isset($_POST['enroll'])) {
$student_id = intval($session->user_id);
$course_id = $course_id;
$date = date('Y-m-d');
我需要PDO功能,如果用户已经COURSE_ID存在返回false。如何验证用户是否已经注册的课程在PHP
***if ($enroll->student_id has this->course_id) {
$message = "<b>U already enrolled continue</b>";
}else{***
$enroll->user_id = $user_id;
$enroll->course_id = $course_id;
$enroll->en_date = $date;
$enroll->create();
// }
这是我的学生表列
- std_id
- FIRST_NAME
的,这是我的课程表
- COURSE_ID
- 课程名称
我也有报名表
- ID
- student_id数据
- COURSE_ID
我需要验证,如果用户已经使用PHP PDO功能 也采取特定课程的学生人数。
您需要在问题中添加一些代码。你是否要求SQL查询来获得你需要的或者PDO代码来处理它? – JimL