Most of the programs I've used for image management just store the image name and path in the database and the image is located in a directory on your server. I think it would be slower to extract the image from the database and then display vs. using print or echo to write the path/name into the html output.
Not trying to hijack, but this is just what I'm looking for..
I posted the (almost) exact same question some days ago (just below this post), and I'll try the code you posted Dzilly
$type is something like 'image/jpeg'
$name is just the name of the image
$image_data is the binary data of the image
header("Content-Disposition: attachment; filename='$name'");
header("Content-Description: PHP Generated Data");
Hope it works.
Do you output is as : image?id=(id from db) ?
And if you'll have to output some text as well, how would you alter the code?
Just add "echo $myTextVariable" ?