0

I manually inserted a image in longblob field named image ...the image is .gif so i entered mimetype as 'image/gif' but it isn't working??

 $result=mysql_query("SELECT image FROM page WHERE number=$ide"); while($image=mysql_fetch_array($result)) { header('Content-type:'.$image['mimetype']); echo $image['image']; 

Please help it is showig some random binary text instead of the image it also says undefined index mimetype have i done something wrong in defining it ???

1
  • edit-i changed the mimetype to image/gif but the image isnt cropping up still Commented Sep 1, 2011 at 11:07

1 Answer 1

3

You need to get the mime type in your SQL query like so:

$result=mysql_query("SELECT image, mimetype FROM page WHERE number=$ide"); 

The mimetype should be image/gif

Sign up to request clarification or add additional context in comments.

2 Comments

did that ..the error notice didn't come but the image also didn't show up.the page is blank?@Treffynnon
Sounds like the image data might have been corrupted when you inserted it into the database. If you do a diff on the data and that of the original image file is it any different?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.