Re: I'm really stuck!
| From: | William Fong | Date: | Fri, 01 Mar 2002 01:33:18 +0000 |
| Subject: | Re: I'm really stuck! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17380@lists.php.net to get a copy of this message | ||
$query="SELECT id FROM wt_users WHERE uid=($session['uid'])";
Always print your queries if they do not work. I don't know if { } will
mess anything up since I've never used them. Your doublequotes in your
array will end your statement at [.
if( isset( $id ) ) { <-- use isset (http://www.php.net/isset )
$data = mysql_query($result,0,"bin_data");
$type = mysql_query($result,0,"filetype"); <-- is that supposed
to be query or result?
HTH,
-w
--
William Fong - wfong@mookandblanchard.com
Phone: 626.968.6424 x210 | Fax: 626.968.6877
Wireless #: 805.490.7732 | Wireless E-mail: 8054907732@mobile.att.net
----- Original Message -----
From: "Jennifer Downey" <jendowney@attbi.com>
To: <php-db@lists.php.net>
Sent: Thursday, February 28, 2002 4:40 PM
Subject: [PHP-DB] I'm really stuck!
Hi all,
I'm really stuck and I'm not asking anyone to re-write this just show me
what is wrong, or explain why it wont work. It just seems logical that this
should work.
The first query will print the pet id in the browser.
$query="SELECT id FROM wt_users WHERE uid={$session["uid"]}";
$ret = mysql_query($query);
while(list($pet)=
mysql_fetch_row($ret))
print("<BR>your pet id is $pet");
So if $pet will print the id from the wt_users (has a value of 3) and I
assign $id = $pet (id also has a value of 3 in image_data) why doesn't it
show the image?
if($id) {
$id = $pet;
$query = "select bin_data,filetype from image_data where id=$id";
$result = mysql_query($query);
$data = mysql_query($result,0,"bin_data");
$type = mysql_query($result,0,"filetype");
Header( "Content-type: $type");
echo $data;
};
echo "<img src=\"petdata.php?id=$id\">";
Thanks
Jennifer Downey