Okay, so my end goal is to display an image (or multiple in a blog type style) that is stored in a database(MySQL) as a blob. Right now it display a broken image icon (). This is what I've tried so far:
<?php
$link = mysql_connect('HOST','USER','PASS!') or die("Could not connect to database");
$dbsel= mysql_select_db('DATABASE', $link) or die("Couldn't select database.");
$result = mysql_query("SELECT * FROM bmblog");
while($row = mysql_fetch_assoc($result))
{
echo "<img src='php/imgView.php?imgId=".$row['media']."' />";
echo "<center>" . "<font color='white'>" . "<FONT FACE='timesnewromans'>" . nl2br(htmlspecialchars($row['msg']));
echo "<br>";
echo "<br>";
};
?>
Also
echo "<img src='data:image/jpeg;base64," . base64_encode($row['media']) . '" />';
echo "<center>" . "<font color='white'>" . "<FONT FACE='timesnewromans'>" . nl2br(htmlspecialchars($row['msg']));
Both display the same broken image icon. I did notice however without trying to echo the second line (of text) I did get a full boarder around the broken image icon that would have been about the size of the image. This is not the same for the first method though. I've been searching for a few hours now and have found tons of post about this, but none that seemed to work for me or make sense, I am fairly new to PHP so this may be something simple I am missing; Either way thank you in advance for any help it is greatly appreciated!