Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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

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


and in image.php I have the code to retrive the values.
Posted
Updated 26-Jul-12 2:52am
v4
Comments
Sandeep Mewara 26-Jul-12 8:02am    
Surely some issue in your code, difficult to comment for anyone until you share.
Malli_S 26-Jul-12 8:54am    
Edit - Sentence re-framing and code formatting.
StianSandberg 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 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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900