orasysco Posted March 1, 2011 Share Posted March 1, 2011 Guys, i need your help,i have one table employee with empno=number,image=blob, images uploaded sucessfully and insert into database but when i am trying to retrieve records image are not displaying instead of it some encrypted form shows please help me Quote Link to comment https://forums.phpfreaks.com/topic/229286-images-not-displaying-from-mysql/ Share on other sites More sharing options...
AbraCadaver Posted March 1, 2011 Share Posted March 1, 2011 header('Content-type: image/jpeg'); echo $row['image']; Quote Link to comment https://forums.phpfreaks.com/topic/229286-images-not-displaying-from-mysql/#findComment-1181440 Share on other sites More sharing options...
.josh Posted March 1, 2011 Share Posted March 1, 2011 sounds like you are not actually creating an image resource from the image column in your db, and outputting it as an image. You should be selecting the data from the image column in your db and using imagecreatefromstring() with that data to create the image resource and then outputting the image by setting the content type with header() and imagepng() or imagejpeg() or similar (based on what image type your image data is saved as). See the example in the imagecreatefromstring() manual entry. Quote Link to comment https://forums.phpfreaks.com/topic/229286-images-not-displaying-from-mysql/#findComment-1181442 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.