PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

删除复选框选中的数据,不管选中多少,传过去的值只有一个,请哪里的有关问题

PHP中文网
PHP中文网 原创
2023-02-28 13:26:01 784浏览

问题:

删除复选框选中的数据,不管选中多少,传过去的值只有一个,请哪里的问题

<br>
<table width="49%" cellspacing="1" bgcolor="#0093C4" id='demotable1'><br>
   <thead><br>
     <tr><br>
       <th width="3%"><INPUT name="chkAll" id="chkAll" title="全选" onClick="ChkAllClick('delivery[]','chkAll')" type="checkbox" /></th><br>
       <th width="8%" class="STYLE3">Item Code</th><br>
       <th width="12%" class="STYLE3">SKU</th><br>
       <th width="15%" class="STYLE3">ASIN</th><br>
       <th width="21%" class="STYLE3">Description</th><br>
       <th width="12%" class="STYLE3">Type</th><br>
       <th width="9%" class="STYLE3">Delivery Areas</th><br>
       <th width="10%" class="STYLE3">Account</th><br>
       <th width="10%" class="STYLE3">FNSKU</th><br>
     </tr><br>
   </thead><br>
   <tbody><br>
     <?PHP<br>
  while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {<br>
  ?><br>
     <tr><br>
       <td><input type="checkbox" name="delivery[]" value="<?PHP echo $row['id']; ?>" /></td><br>
       <td><?PHP echo $row['item_code'] ?></td><br>
       <td><?PHP echo $row['sku'] ?></td><br>
       <td><?PHP echo $row['asin'] ?></td><br>
<br>
<br>
<br>
function delClick(){  <br>
var val = $('input:checked').val();    <br>
 window.location.href="http://www.php1.cn/">
<br>
} <br>
<br>
<br>
        <input type="button" class="btn" id="add_btn"  value="新 增" /><br>
       <br>
          <input name="button" type="button" class="btn" onclick="delClick()" value="删 除" /><br>
<br>
    case 'del' : //删除<br>
    <br>
$id=$_GET["delivery"];<br>
$SQL = "delete from `sku_rule` where id in($id)";<br>
        $result = mysql_query($SQL);<br>
        if (mysql_affected_rows($conn) != 1){<br>
        <br>
            echo "<script>alert('删除失败!');location.href="http://www.php1.cn/">
        } else {<br>
        <br>
            echo "<script>alert('删除成功!');location.href="http://www.php1.cn/">
        }<br>
        break;<br>


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。