Multiple Image Display Problem

From: Date: Thu, 20 Dec 2001 17:06:34 +0000
Subject: Multiple Image Display Problem
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-15152@lists.php.net to get a copy of this message
I am having problems displaying two different images on the same page. (stored as binary files in two different db tables) Instead of getting two different images, I am getting the first image twice, although the scripts are going to two different database tables to get the two images. Is there a way to get both images to display on this page? Any help would be much appreciated. Thank you. The main code is: <? if (count($result3) > 0) { while ($result_array3 = mysql_fetch_array($result3, MYSQL_ASSOC)) { if ($result_array3["speaker_id"] !== "") { echo "<p><IMG SRC=\"small_image.php?speaker_id=" . $result_array["speaker_id"] . "\"></p>"; } } } if (count($result4) > 0) { while ($result_array4 = mysql_fetch_array($result4, MYSQL_ASSOC)) { if ($result_array4["speaker_id"] !== "") { echo "<p><IMG SRC=\"large_image.php?speaker_id=" . $result_array["speaker_id"] . "\"></p>"; } } } ?> ----------------- small_image.php: <? include("include.inc"); $sql = "SELECT bin_data, filetype, filename, filesize FROM smphoto_bin_data WHERE speaker_id=$speaker_id"; // . $HTTP_SESSION_VARS["speaker_id"]; $result = @mysql_query($sql); $data = @mysql_result($result, 0, "bin_data"); $name = @mysql_result($result, 0, "filename"); $size = @mysql_result($result, 0, "filesize"); $type = @mysql_result($result, 0, "filetype"); header("Content-type: $type"); header("Content-length: $size"); header("Content-Disposition: attachment; filename=$name"); header("Content-Description: PHP Generated Data"); echo $data; ?> ---------------- large_image.php: <? include("include.inc"); $sql = "SELECT bin_data, filetype, filename, filesize FROM lgphoto_bin_data WHERE speaker_id=$speaker_id"; $result = @mysql_query($sql); $data = @mysql_result($result, 0, "bin_data"); $name = @mysql_result($result, 0, "filename"); $size = @mysql_result($result, 0, "filesize"); $type = @mysql_result($result, 0, "filetype"); header("Content-type: $type"); header("Content-length: $size"); header("Content-Disposition: attachment; filename=$name"); header("Content-Description: PHP Generated Data"); echo $data; ?>

« previous php.db (#15152) next »