If you often get the image, you probably would be better off storing it as a file and saving the path to it in order to keep the database running when the image is extracted.
Otherwise, save the contents of the image file in the BLOB column, and then type <img src="image.php?id=1234" /> in HTML.
image.php should search for the image with ID 1234 in the database, extract the contents of this BLOB column and print it after serving the correct HTTP header, for example. header('Content-type: image/gif');
But seriously. Just save the image file. I promise much less pain.
Matchu
source share