The images are very small files (<20kb) so I was storing them in the database. BTW, the following code at least returns the correct file type, though the basic problem remains:
$query = "SELECT image_data,image_name,image_type,image_size FROM table";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$image_data = stripslashes($row[0]);
$image_name = $row[1];
$image_type = $row[2];
$image_size = $row[3];
$part_no = $row[4];
header("Content-Disposition: inline; filename=$image_name");
header("Content-type: $image_type");
header("Content-length: $image_size");
echo $image_data;
I've thought about handling it the way you suggested but ran into a problem (I'm sure this is an excessively stupid question but here goes)- how do I arrive at the correct path name? I'm using SQLyog to insert the image files and other pertinent info in the table. Is the path name something like /server name/database/table?
Thanks for replying- any more pearls of wisdom you might have are most welcome. If I can solve this issue I can develop a truly dynamic online catalog.