Click here to Skip to main content
12,450,937 members (48,297 online)
Rate this:
 
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
Updated 26-Jul-12 2:52am
Malli_S29.1K
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.
AlluvialDeposit 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

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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 27 Jul 2012
Copyright © CodeProject, 1999-2016
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