php - 将 MYSQL 生成的选定记录移动到另一个表 - 复选框和按钮
问题描述
HTML表格:
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="table" class="tablesorter">
<thead>
<tr>
<th><h3>ID</h3></th>
</tr>
</thead>
<tfoot>
<tr>
<th><h3>ID</h3></th>
</tr>
</tfoot>
<tbody>
<?php getClicksReport(); ?>
</tbody>
函数PHP:
function getClicksReport() {
$query = mysql_query("SELECT * FROM clicks ORDER BY id DESC") or die(mysql_error());
while($click = mysql_fetch_assoc($query)) {
echo '<tr>';
echo '<td>' . $click['id'] . '<span class="idcheckbox"><input name="id[]" type="checkbox" value="'.$click['id'].'"/></td>';
}
}
和.....
if(isset($_POST['akceptlead']) && $_POST['id']){
$total = count($_POST['id']);
for($i=0; $i<$total; $i++) {
$akceptujLeada = mysql_query("DELETE FROM leads WHERE id ='".$_POST['id'][$i]."'") or die(mysql_error());
}
header("Location: clicksReport.php");
}
我在表格 html 中选择记录,单击“接受选择”按钮,但没有任何反应。
任何人都可以帮助我吗?
解决方案
推荐阅读
- adc - lpc1768中ADC的采样频率是多少?
- python-3.x - 使用不同权重的刻度标签
- mysql - 当我尝试使用 php 和 sql 在“餐厅”中预订餐桌时遇到问题
- python - 如何从 AWS boto3 中的已完成容器复制文件
- python - python中的R模糊连接
- c# - 什么是类,为什么要使用多个(C#)?
- chrome-native-messaging - 如何显示本机消息传递端口连接错误
- node.js - 如何修复:TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]:在启动脚本中使用 ts-node-dev 时
- javascript - 用字符串和索引反应键
- amazon-web-services - 运行更新时 Cloudformation 无法检索 DBRootPassword