I have created an image gallery using the PHP code below, which will retrieve the images from a database.
How can I add a delete symbol to the images so that I can delete it after getting retrieved from the database?
<div class="container">
<h1>Dynamic Image Gallery </h1>
<div class="gallery">
<div class="card">
<?php
//Include database configuration file
include('dbConfig.php');
//get images from database
$query = $db->query("SELECT * FROM images ORDER BY uploaded_on DESC");
if($query->num_rows > 0){
while($row = $query->fetch_assoc()){
$imageThumbURL = ' images/thumb/'.$row["file_name"];
$imageURL = 'images/'.$row["file_name"];
?>
<a href="<?php echo $imageURL; ?>" data-fancybox="group" data-caption="<?php echo $row["title"]; ?>" >
<img src="<?php echo $imageThumbURL; ?>" alt="" />
</a>
<?php }
} ?>
</div>
</div>