我想在php中創建一個在線attendace,我從學生表中提取學生列表,並且想要將所有chkboxs作爲存在並且如果選中爲不存在,則將其作爲缺席, 我無法做到這一點。插入多行數據到從另一個表中提取的數據庫
<div class="attendance">
<form accept="att.php" method="POST">
<?php
$sel_sql = "SELECT * FROM student";
$run_sql = mysqli_query($conn,$sel_sql);
while($rows = mysqli_fetch_assoc($run_sql)){
$id = $rows['id'];
echo '<input type="checkbox" name="status" value="'.$id.'" checked>'.ucfirst($rows['f_name']).'';
}
?>
<input type="submit" name="submit_attendance" value="Post Attendance">
<?php echo $msg; ?>
</form>
</div>
它顯示知府學生名單,但我不知道如何設置插入查詢所有這些chkboxes的
更好地給你的表格樣本結構 –
你真正想要的是什麼還不清楚。但現在首先把如果出席標記爲P,然後只顯示選中其他不顯示檢查。 –
我想從學生表中使用學生名單附加附表。我可以輕鬆地將用戶作爲複選框在頁面上獲取,但我無法將這些學生插入到考勤機中。 – shinzu