Re: [PHP-DB] Multiple Image Display Problem

2001-12-20 Thread Dobromir Velev

Hi,
your code seems fine except for the $result_array["speaker_id"] variable used when 
calling the image files.
Shouldn't this be $result_array3["speaker_id"] and $result_array4["speaker_id"] 
respectively?
Did you try to call the second image separately to see what is coming out of the 
database?

Hope this helps

Dobromir Velev
Web Developer
http://www.websitepulse.com

-Original Message-
From: Christopher Martin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, December 20, 2001 19:08
Subject: [PHP-DB] Multiple Image Display Problem


>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 "$result_array["speaker_id"] . "\">";
>}
>}
>}
>if (count($result4) > 0) {
>while ($result_array4 = mysql_fetch_array($result4, MYSQL_ASSOC)) {
>if ($result_array4["speaker_id"] !== "") {
>echo "$result_array["speaker_id"] . "\">";
>}
>}
>}
>?>
>-
>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;
>?>
>
>
>-- 
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Multiple Image Display Problem

2001-12-20 Thread Christopher Martin

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:
 0) {
while ($result_array3 = mysql_fetch_array($result3, MYSQL_ASSOC)) {
if ($result_array3["speaker_id"] !== "") {
echo "";
}
}
}
if (count($result4) > 0) {
while ($result_array4 = mysql_fetch_array($result4, MYSQL_ASSOC)) {
if ($result_array4["speaker_id"] !== "") {
echo "";
}
}
}
?>
-
small_image.php:



large_image.php:




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]