You can't do that... You'd be outputting the binary data right
into a text based web page....
If you output an image from a PHP script then thats all you can
output, you can mix image(binary) and html(text).
// Connect to database.
// Fetch image data.
// Close database connection.
header( "Content-Type: image/jpeg" ); // If it was a jpeg
echo $row[1];
Actually i lied, you "can" output both image data and HTML from
one script, in one go. You need to encode the image on a <img
src="data:image/jpeg;base64," . $image_encoded > ...
So in your case.
<?
$conn = mysql_connect($host, $user, $pass);
mysql_select_db($somedb, $conn);
$query = "SELECT * FROM webImages";
$result = mysql_query($query, $conn);
echo "<table width=\"50%\" align=\"center\">";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td><IMG SRC=\"data:image/jpeg;base64," . base64
_encode($row[1]) . "\"></td>";
echo "<td><IMG SRC=\"data:image/jpeg;base64," . base64
_encode($row[2]) . "\"></td>";
}
echo "</table>";
mysql_free($result);
mysql_close($conn);
?>
But why you would want to do that is beyond me. Im really not
sure what the benifit is. It could infact be a very bad idea.
----------------------------------------------
Posted with NewsLeecher v2.0 Beta 4
* Binary Usenet Leeching Made Easy
*
http://www.newsleecher.com/?usenet
----------------------------------------------