$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 - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732 | Wireless E-mail: [EMAIL PROTECTED] ----- Original Message ----- From: "Jennifer Downey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php