stepping through mysql blob results
Posted: Tue Aug 04, 2009 8:56 am
I'm trying to write a script that selects all images from a MySQL table that have a common field and displays them all. This seems like it would work, and does when I use it to step through a different column in the table, but not for the blobs. It only shows the first.
Any ideas greatly appreciated.
Code: Select all
<?php
include '../lmp_includes/lmp_utilities.php';
$db = db_connect();
if ($_GET[id]) {
$id = mysql_real_escape_string($_GET[id]);
header('Content-type: image/jpg');
$q = "select * from images where propID = $id";
$r = mysql_query($q);
while ($d = mysql_fetch_object($r)) {
echo $d->image;
}
} else {
echo "Can't do much without an id now can I?";
}
?>