[英]how to insert all this checkbox value into same id but different rows of one column?
how to insert all this checkbox value into same id but different rows of one column 如何将所有此复选框值插入同一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>
You can use below code in php to check the checked box values using array and try to insert inside foreach with that particular id 您可以在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."')";
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.