I made a form where I upload multiple photos and then stored them on a single row in my database. How can I echo all the photos? Below is my sample code trying to display the photos from database and screenshot of my database and how it look like when I run the code.
<?php include($_SERVER['DOCUMENT_ROOT'].'/project/admin/add/commsheetConnect.php'); ?>
<style type="text/css">
.comms-image img{
display: block;
}
</style>
<?php
$conn = mysqli_connect(db_host, db_username, db_password, db_name, db_port);
$sql = "SELECT image FROM comms_images";
$res = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($res)) {
echo "<div class='comms_image'>";
//DISPLAY IMAGE
echo "<img src='/project/decors/photos/comms_img/".$row['image']."'>";
}
?>
What the photos look like in my database:
What the code looks like when I run it: