Jump to content

Working with blob


rezzkilla

Recommended Posts

I've stored a jpeg in a mysql database using the fopen and fread commands then addslashes and placing the contents in a blob field. That's seemingly ok and all. In the past to display the image, I've simply headered the content type and length and then echoed the pic variable and that's worked. Now, that gives me a garbled mess of characters of music notes and such. So, I've tried imagecreatefromstring() and that clears up the characters but just outputs a resource id. What else do I need to do and what exactly is going on? Why won't the jpeg display. Furthermore, is there something more I should be doing when initially storing the image?? Also, I stored the file type but it's image/pjpeg. Is that different from image/jpeg? I've come a long way on learning php, but this is the first time I've worked with blobs so any help or advice will be greatly appreciated. Moreover, please do not tell me to store the filepath and just use a file system for pictures. Please try to stick to the problems in question. Many thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/65368-working-with-blob/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.