With the code below, I'm displaying data from a MySQL database in a Table.
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['image']; ?></td>
<a title="Delete" href="deletestudent.php?id=<?php echo $row['id']; ?>"><button class="btn btn-danger btn-mini"> Delete</button></a></td>
The first row displays the picture name, while the second row displays the image that is located inside the images directory.
I can delete the row using the code below:
<?php
include('../connect.php');
$id=$_GET['id'];
$result = $db->prepare("DELETE FROM student WHERE id= :memid");
$result->bindParam(':memid', $id);
$result->execute();
header ("location: students.php");
?>
But I also want to remove one image from the Images folder. How can I do that?