Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image problem

Status
Not open for further replies.

bastienk

Programmer
Joined
Mar 3, 2004
Messages
326
Location
CA
I have to take an image out of a mysql db (yeah, i know "don't!" but no choice as the app is mainly written in ASP and I am doing some post insertion processeing in php...

Basically I need to extract the image from the DB, thumbnail it, and stick it back in...I am testing the extraction part but only end showing the binary cod efor the image not the image itself...so the extract works...have set the header, but still no joy...

Code:
header("Content-type: image/jpeg");
if (($results)&&(mysql_num_rows($results)==1)){
  
  //we have the image 
  while ($row=mysql_fetch_array($results)){
    $img = $row['evidence'];
  }//end while

}//end if

echo "<p><img src='$img'></p>";

All images are jpgs, so the image type header is not the issue

any ideas?


Bastien

Cat, the other other white meat
 
The "src" attribute of an image can't be image data -- it must be a URL. What's in the column evidence?




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
the image is in the evidence column..




Bastien

Cat, the other other white meat
 
got it...just changed to
Code:
print $img
from
Code:
echo "<p><img src='$img'></p>";


Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top