Re: I'm really stuck!

From: Date: Fri, 01 Mar 2002 00:52:53 +0000
Subject: Re: I'm really stuck!
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-17378@lists.php.net to get a copy of this message
if($id) { $id = $pet; you first check for $id and then set it? > 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) { if you want it for every row, there are missing { } with the while statement. Op vrijdag 01 maart 2002 01:40, schreef Jennifer Downey: > 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

« previous php.db (#17378) next »