I know that I'm using depreciated MySQL, that the page will be very heavy, and I should be linking the image files into the database rather than inserting them directly there. Besides that, I'm having trouble displaying the BLOB images from the database table "builds" in column "image".
Here is my code: Issues displaying opening and closing PHP tags.
PHPMyAdmin Picture:
Webpage Display:
include ("connect.php");
$conn = mysql_connect("localhost", $id, $pw); //Start of Establishing Connection to Database "akimble"
if (!$conn) {
die ("Error connecting: " . mysql_error()); //Displays What the Error was if Present
}
mysql_select_db($db, $conn);
$sql = "SELECT * FROM builds"; //Selects Everything From the Table "userinfo" in "akimble" Database
$results = mysql_query($sql, $conn); //Assigning all Data
echo "<table cellpadding=10 border=1>
<tr>
<th>User ID</th>
<th>Image Name</th>
<th>Image</th>
</tr>";
while ($entries = mysql_fetch_array($results)) { //Fetch all Information within "results" Variable
echo "<tr>";
echo "<td>" . $entries['id'] . "</td>";
echo "<td>" . $entries['name'] . "</td>";
header("Content-type: image/jpg");
echo '<img src="data:image/jpg;base64,' . base64_encode( $row['image'] ) . '" />';
echo "</tr>";
}
echo "</table>";
mysql_close($conn);
Thanks for the help, I've been struggling for hours on this.