我如何从我的复选框中获取未选中的值?
我有 3 个单选按钮。当我单击第一个必须选中所有复选框时,第二个单选按钮未选中所有复选框。第三个单选按钮可以检查一些复选框,所有未检查的复选框我想通过 UPDATE Query 将值从 0 发送到 1 到 DB。单选按钮工作正常,但我没有得到未选中复选框的值以将其发送到我的更新查询。这是带有表单元素的第一页的代码:
//That is only a short version of my Select who works correct
$abfrageT = "SELECT DISTINCT id_dexpd, acores.code_regate, detail_exp_devise.num_expertise ...
FROM acores, infos_bureau, demande_expertise_dev, detail_exp_devise, agents
WHERE acores.id_acores = '$id_acores'
AND demande_expertise_dev.date_dem_exp = '$expdev' ...";
$ergebnisT = mysql_query($abfrageT) or die("Query failed with error: ".mysql_error());
while($abfrageT = mysql_fetch_assoc($ergebnisT))
{
$newcup = $abfrageT['coupure'];
$newpd = $abfrageT['code_devise'];
$newns = $abfrageT['num_serie'];
$IDX = $abfrageT['id_dexpd'];
$NumExp = $abfrageT['num_expertise'];
echo"<tr>";
// Here are the ckeckboxes:
echo"<td bgcolor=".$bgcolor." id='myGlob2' align='center'><input type='checkbox' name='check1' value='$abfrageT[id_dexpd]' /></td>";
echo"<td bgcolor=".$bgcolor." id='myGlob2'> ". $newcup ." ". $newpd ."</td>";
echo"<td bgcolor=".$bgcolor." id='myGlob2' > ". $newns ."</td>";
echo"<td > </td>";
echo'</tr>';
这里是我更新的第二页代码:
$NumExp = $_GET['NumExp'];
$IDX = $_GET['check1'];
$QryUpAnswerIdn = "UPDATE detail_exp_devise SET detail_exp_devise.exp_val = 1
WHERE detail_exp_devise.num_expertise = $NumExp
AND id_dexpd = $IDX";
$ResUpAnswerIdn = mysql_query($QryUpAnswerIdn) or die("Query failed with error: " . mysql_error());
if ($IDX) {
$QryUpAnswerId = "UPDATE detail_exp_devise SET detail_exp_devise.exp_val = 0
WHERE detail_exp_devise.num_expertise = $NumExp
AND id_dexpd = $IDX";
$ResUpAnswerId = mysql_query($QryUpAnswerId) or die("Query failed with error: " . mysql_error());
}
这里有一张图片:
任何想法?
提前 THX