So I'm trying to display images that users upload on the home page. However, while the other info (description, title, username, date variables) shows up fine, the image will not show up for some reason.
Here is the code on my home/index.php page :
<!doctype html>
<html>
<head>
<?php
include('header.php');
?>
<title>Splindr</title>
<link type="text/css" rel="stylesheet" href="index.css">
</head>
<body>
<div id="contentWrapper">
<?php
$conn = mysqli_connect("localhost","root","") or die ("No SQLI");
mysqli_select_db($conn, "sample") or die ("No DB");
$sqli = "SELECT * FROM `photos` WHERE `username` = 'ralston3'";
$result = mysqli_query($conn, $sqli) or die ("No query");
while($row = mysqli_fetch_assoc($result)) {
$username = $row['username'];
$title = $row['title'];
$description = $row['description'];
$image_name = $row['image_name'];
$image_id = $row['image_id'];
$date = $row['post_date'];
}
$image_id = $image_id;
echo "<div id='photo'><div id='image'><img src='$image_id'><div id='info_header'>$title   by   $username   on   $date </div><div id='imageInfo'>$description</div></div></div>";
?>
</div>
</body>
</html>
I'm trying to work this so that when users upload their picture, the picture gets displayed on the homepage. Like I said, all other info displays properly except the image.