我有三个相互连接的文件,我的问题是我的删除功能似乎不起作用。我想知道我的“公共函数 Delete_Lease($db) {”中缺少什么,代码如下所示。基本上,我使用一个 for each 来显示一个表格,编辑没有问题,但删除只是停留在同一页面上并且没有任何效果。
表名: for_lease
值: leaseid、lease_type、lease_name、lease_address、lease_price、lease_condition、lease_description、featured_photo、createddate
for_lease.php
<?php
session_start();
require_once('for_lease.vc.php');
?>
<?php foreach($lstProperty as $rowProperty) { ?>
<tr align="center">
<td>
<a href="for_lease_edit.php?i=<?php echo($rowProperty['leaseid']); ?>"><input type="submit" class="btn bg-color-blue color-white form-control" name="edit" value="EDIT"></a>
</td>
<td>
<?php
echo($rowProperty['lease_name']);
?>
</td>
<td>
<?php
echo($rowProperty['lease_address']);
?>
</td>
<td>
<?php
echo($rowProperty['lease_type']);
?>
</td>
<td>
<?php
echo 'PHP'.' '.number_format(($rowProperty['lease_price']));
?>
</td>
<td>
<?php
echo($rowProperty['lease_condition']);
?>
</td>
<td>
<?php
echo( date("Y-m-d", strtotime($rowProperty['createddate']) ));
?>
</td>
<td>
<a href="for_lease.php?delete=<?php echo($rowProperty['leaseid']); ?>" onclick="return confirm('Are you sure?');"><input type="submit" class="btn bg-color-red color-white form-control" name="delete" value="DELETE"></a>
</td>
</tr>
<?php } ?>
千巷猫影
湖上湖