inserting pictures in a SQLdatabase

Status
Not open for further replies.

hargi22

Solid State Member
Messages
20
I got a mysql database with a php search function that will seach it and display the results but i need it to display a picture
i have tryed using a blob to put the picture in but when it is displayed on the web page it comes up with loads of letters not the picture
what am i doing wrong
 
Assuming you are doing everything else right, you have to tell PHP to send the MIME type manually.

You need to use:
Code:
header("Content-type: image/jpeg");

Also, once you do that, you need to output the image with imagejpeg($img) where $img is your php image structure.
 
Status
Not open for further replies.
Back
Top Bottom