シナリオ: 私は大学の出席システムを作成していますが、mysql を更新し、チェックボックスを使用して学生の欠席または出席をマークすることに行き詰まっています。
そのため、現在、表示したいデータをフィルタリングすることができました。これは、student_id、fname、lname、present です。以下のコードをご覧ください
<strong>Class Register:</strong> </br>
<?php
$test3= "SELECT * FROM course_attendance, students, courses, attendance WHERE course_attendance.course_id=courses.course_id AND course_attendance.week_id=attendance.week_number_id AND course_attendance.student_id= students.student_id AND courses.course_id='101' AND attendance.week_number_id='2' ";
$result = mysql_query($test3) or die(mysql_error());
echo "</br><table border='1' align='center'><tr> <th><strong>Student ID</strong></th> <th><strong>First Name </strong></th> <th><strong>Last Name</strong></th> <th><strong>Present</strong></th> </tr> ";
while($rows=mysql_fetch_array($result)){
echo "<tr><td width='100' align='center'>" .$rows['student_id'].
"</td><td width='120' align='center'>" .$rows['fname'].
"</td><td width='120' align='center'>" .$rows['lname'].
"</td><td width='120' align='center'>" .$rows['present'].
"</td><tr width='120' align='center'>";
}
echo "</table>";
?>
したがって、現在、これはデータを示しています:student_id、fname、lname、present.
MySQL のフィールド 'Present' は unsigned tinyint です。これをチェックボックスにして、ユーザーが学生の出席または欠席をマークしてから mysql に更新できるようにしたいと考えています。また、現在のフィールドだけで、学生ID、fname、およびlnameを編集できるようにしたくありません。これは可能ですか?
誰かが私をうまく助けてくれたら、前もって感謝します。私は永遠に感謝します!