如何将所有此复选框值插入同一ID但同一列的不同行中
<input type="checkbox" value="Return" name ="secondtechno[]">Return<br>
<input type="checkbox" value="Payment" name ="secondtechno[]">Payment<br>
<input type="checkbox" value="Audit" name = "secondtechno[]">Audit<br>
<input type="checkbox" value="Form15CA" name = "secondtechno[]">Form15CA<br>
<input type="checkbox" value = "Form15CB" name = "secondtechno[]">Form15CB<br>
答案 0 :(得分:0)
您可以在php中使用以下代码来检查使用数组的复选框的值,并尝试在具有特定ID的foreach中插入
$id= 'Your_id';
if(!empty($_POST['secondtechno'])) {
foreach($_POST['secondtechno'] as $check) {
//echo $check;
//$sql = "INSERT INTO YourTable(id, columnname)VALUES ('".$id."', '".$check."')";
}
}