Jump to content

php image display


proctk

Recommended Posts

Hi.

I have been able to sucessfully load images to a database.  I can get this to display on the page. For some reason it the code below will not loop through and  display the individual pitchers.  If there are three pitchers in the table it will display the three pitchers but not the correct images.  it repeats the first image that matches the search.

something interesting is when i rest my mouse over the image to see the path if I where to click on it, it shows the correct file name but not the correct image.

Thank you for any help :)


Displaying the image
[code=php:0]
<HTML>
<BODY>
<?

include 'db.php';


$result=mysql_query("SELECT * FROM upload") or die("Can't Perform Query");
While($row=mysql_fetch_object($result)) {

echo "<A HREF =\"secondType.php?name=$row->name\"> <IMG SRC=\"secondType.php?name=$row->name\" width=100 Height=125></a>";
}
?>
</BODY>
</HTML>
[/code]


SecondType.php script
[code=php:0]

<?


<?


include 'db.php';

/*$name = $_REQUEST['name'];
echo $name;*/


$result=mysql_query("SELECT * FROM upload WHERE name=$name") or die("Can't perform Query");
$row=mysql_fetch_object($result);
Header( "Content-type: image/jpeg");
echo $row->content;

?> 
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.