我想从中选择多行,checkbox
并希望通过单击按钮一次全部更新它们。我尝试了多种方式..但不起作用..你能帮忙吗?它显示错误为Undefined index: checkbox
<td>
<input type="hidden" name="id" id="id" value="<?php echo $row["file_serial_id"]; ?>" />
<input type="checkbox" name="checkbox[]" id="checkbox[]" value="<?php echo $row['file_serial_id']?>" />
</td>
if(isset($_POST['send_btn']) and $_POST['send_btn']=="Send"){
$checkbox = $_POST['checkbox']; //from name="checkbox[]"
$countCheck = count($_POST['checkbox']);
for($i=0;$i<$countCheck;$i++){
$del_id = $checkbox[$i];
$sql2 = "UPDATE retained_file_mst SET mark_to_dispose=1 WHERE file_serial_id='$del_id'";
$result2 = mysql_query($sql2,$conn);
}
// if successful redirect to delete_multiple.php
if($result2){
echo "success";
}else{
echo "error";
}
}