更新数据库值,其中选中复选框

时间:2018-05-09 20:51:31

标签: php checkbox sql-update

我在表格行中有复选框,想要为多个UPDATE行值添加一个按钮

HTML:

<?php foreach ($product as $namee): ?>
    <tr>
        <td><input type="checkbox" name="check" id="box[<?= $namee->rqn; ?>]"></td>
        <td><?= $namee->rqn ;?> </td>
        <td><?= $namee->ccn ;?> </td>
        .
        .
        .

        <td><a class="btn btn-danger" href="?reqnum=<?= $namee->rqn ?>&sts=deleted" >X</a></td>
   </tr>
<?php endforeach ;?>

PHP:

if(isset($_GET['sts'])&&($_GET['reqnum'])&&($_GET['deleted']))
{


} catch (Exception $exc){
    echo $exc->getTraceAsString();
    exit();
}

$query ="UPDATE `costumers` SET 
`status`=:sts,
`doe`=:doe

        WHERE
            `rqn` = :reqnum";
$pdoResult = $DB1->prepare($query);
$pdoExec = $pdoResult->execute(array(                                     
":reqnum"=>$reqnum,
":sts"=>$sts,
":doe" =>(date("Y-m-d H:i:s"))
));}?>

我需要帮助填写sql&gt;&gt;&gt;在哪里rqn = ????? (ⅰ)

0 个答案:

没有答案