rezzkilla Posted August 17, 2007 Share Posted August 17, 2007 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. Quote Link to comment Share on other sites More sharing options...
fenway Posted August 21, 2007 Share Posted August 21, 2007 No idea about that function you spoke about, but I know that addslashes can do funny things. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.