So i have a query running and i get results in a while loop. In the while loop I want to set $image as a variable for a image that is needed to be displayed on a html page, by using the variable. I am not able to get the image displayed on the html.
By the way the images are located in the folder.
PHP Code :
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$image = "<img src='images/image1.png'>";
}
}
HTML Code:
<?php include 'File.php';?>
<img src="<?php echo $image; ?>" alt="Mountain View" style="width:304px;height:228px;">