我的代碼有什麼問題?刪除表格的行代碼
我的PHP正在工作,但刪除按鈕不起作用!
if(isset($_POST['delete'])) {
$ID = $_POST['value'];
$delete = "DELETE FROM tbl_document WHERE ID = $ID";
$result = mysqli_query($con,$delete);
}
$query = "SELECT * FROM tbl_document LIMIT $start, $end";
$result = mysqli_query($con,$query);
echo "<table border='1' width='300' height='160' align = center id='result'>";
echo '<tr>
<th width="80">ID</th>
<th width="200">Title</th>
<th width="260">Presented To</th>
<th width="260">Presented By</th>
<th width="160">Date Submitted</th>
<th>Location</th>
<th width="17%">Option</th>
</tr>';
while($row = mysqli_fetch_array($result)){
echo "<tr align = center >";
<td width='20' height='60'>" .$row['ID']. "</td>";
<td width='120' height='60'>" .$row['Title']. "</td>";
<td>" .$row['Presented_To']. "</td>";
<td>" .$row['Presented_By']. "</td>";
<td>" .$row['Date_Submitted']. "</td>";
<td>" .$row['Location']. "</td>";
"<td width='17%'>";
?>
<?php if($_SESSION['user'] == "1")
?>
<button class="w3-btn w3-red w3-border-large w3-circle" value="<?php echo $row['ID'];?>" name="delete" style="width:40%"><i class="fa fa-trash-o"></i>Delete</button>
<?php } ?>
<?php
echo "</td>";
echo "</tr>";
}
echo"</table>";
的一個大問題 - 這似乎是100%的失蹤了! Pesky代碼不能保持不變... –
請發佈您的代碼,我想你忘了它。 – Arendax
代碼請!!!! –