Page 1 of 1

How to display image from mysql BLOB data type using PHP

Posted: Fri Dec 01, 2017 10:45 pm
by Joeldcruz
Hi

I am using Bootstrap css.
I have an issue to display image with data type BLOB, Really I don't know how to do this.

Pls advise me how to do this.


Thanks!

Re: How to display image from mysql BLOB data type using PHP

Posted: Fri Dec 01, 2017 11:14 pm
by requinix
Make a script that queries the database for the BLOB data and for the type of image data it is, which you need to be storing. Then

Code: Select all

header("Content-Type: " . $image_type_from_database); // image type is like image/png or image/jpeg
echo $blob_data_from_database;