Click here to Skip to main content
11,720,321 members (67,706 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP MySQL
I saved image as blob along with width and height. I have image id, but when I retrieve the image from mysql, image is not getting displayed on my PHP page.

I am saving the image from one page and retriving in another page by passing image id.
I am using this code for src

echo "\n<IMG SRC=\"image.php?image_id=$image_id\" />";

and in image.php I have the code to retrive the values.
Posted 26-Jul-12 1:41am
Edited 26-Jul-12 2:52am
Malli_S27.3K
v4
Comments
Sandeep Mewara at 26-Jul-12 8:02am
   
Surely some issue in your code, difficult to comment for anyone until you share.
Malli_S at 26-Jul-12 8:54am
   
Edit - Sentence re-framing and code formatting.
AlluvialDeposit at 26-Jul-12 10:40am
   
try open the image in a browser, you'll get some more information about the error.. http://localhost/image.php?image_id=123
Mohibur Rashid at 27-Jul-12 1:07am
   
Humm, you better try to write the information into a file and then try to open the file with image viewer. if you can see then I would ask you the code for image.php.

also fllow the suggestion by alluvialdeposit

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Don't use the img src for display the retrive image from mysql

header("Content-type:image/jpeg")
print $image

$image is a image retrive from a mysql.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 2,029
1 OriginalGriff 844
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 27 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100