My delete button is not working.
For a view file it's working - this is my code for view_file.php:
<?php
$sql_id="SELECT * FROM meeting_info where id=".$id ;
`$result2 = $conn->query($sql_id);
if($row2 = $result2->fetch_assoc()) {
$bilno = $row2['bilno'];
}
?>
<body>
<div id="body">
<table align="center" width="90%">
<tr>
<th colspan="6">
<div align="center">
<h3>Meeting Bil.No
<?php echo $bilno; ?> </h3>
</div>
</th>
</tr>
<tr bgcolor="#3366ff">
<td>Bil. Item</td>
<td>File Type</td>
<td>File Size (KB)</td>
<td>View</td>
<td>Edit</td>
<td>Delete</td>
</tr>
<?php
$sql="SELECT * FROM meeting_details where id=".$id ." order by item_no asc";
$result = $conn->query($sql);
while($row = $result->fetch_assoc())
{
if($j%2 == 1) {$colortd = "#99ccff";
}
else {$colortd = "#f5f5f0";}
?>
<tr bgcolor=<?php echo $colortd;?>>
<td>
<?php echo $row['item_no'] ?>
</td>
<td>
<?php echo $row['type'] ?>
</td>
<td>
<?php echo $row['size'] ?>
</td>
<td>
<a class="btn btn-view" href="uploads/<?php echo $row['file']; ?>" target="_blank" alt="<?php echo $row['item_no']; ?>" title="click for edit">
<center><img src="images\iconview.png"></center>
</a>
</td>
<td>
<a class="btn btn-info" href="edit_file.php?edit=<?php echo $row['id']; ?>" title="click for edit" onclick="return confirm('sure to edit ?')">
<center><img src="images\iconedit.png"></center>
</td>
<td>
<a class="btn btn-danger" href="delete_file.php?delete=<?php echo $row['id']; ?>" title="click for delete" onclick="return confirm('sure to delete ?')">
<center><img src="images\icondel.png"></center>
</td>
</tr>
<?php
$j++;
}
//$conn->close();
?>
</table>
</div>
</body>
For the delete button, I want to delete all rows on information that I want to delete. But it's not working. When i click the delete button it's just come out the blank page. The data still have in database and website.
This my delete_file.php code:
<?php
include("db_conn.php");
if (isset($_GET['id']) && is_numeric($_GET['id']))
{
$id =$_GET['id'];
$sql = "DELETE FROM meeting_details WHERE id=".$id;
$result = $conn->query($sql);
}
$conn->close();
?>
</div>