Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sql = "INSERT INTO
- sms_courses (active, student_id, subject_id, teacher_id, class_id)
- VALUES
- (0, :studentid, 0, 0, :classid)
- WHERE NOT EXISTS (
- SELECT * FROM
- sms_courses
- WHERE student_id=:studentid AND class_id=:classid)";
- $result = $pdo->prepare($sql);
- $result->bindValue(':studentid', $student_id, PDO::PARAM_INT);
- $result->bindValue(':classid', $class_id, PDO::PARAM_INT);
- $result->execute();
- /*
- Stwórz wiersz w tabeli sms_courses z wartościami 0, $student_id, 0, 0, $class_id
- Jeśli nie istnieje już wiersz w sms_courses z wartościami $student_id i $class_id
Advertisement
Add Comment
Please, Sign In to add comment