Click to See Complete Forum and Search --> : image problem
vik_pa
03-24-2004, 10:45 AM
could someone please tell me why the images are not being output to the browser. echo $image prints out the correct location so there is no problem there (when i have hardcoded the location in the code, it outputs to the page fine).
for ($i = 0; $i<count($bookauthorArray); $i++){
$query = "SELECT Image FROM book WHERE Book_ID
= '$bookauthorArray[$i]'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
$image = $row["Image"];
echo $image;
echo "<tr>
<td><img src= $image width=100 height=100>
</td>
</tr>";
}
}
Webfreak
03-24-2004, 11:11 AM
Try this echo "<img src=\"$image\" width=100 height=100>";
vik_pa
03-24-2004, 11:23 AM
thanks buddy. it works now
vik_pa
03-24-2004, 11:42 AM
right now I have another problem which is an extension of the code above as follows:
for ($i = 0; $i<count($bookauthorArray); $i++){
$query = "SELECT Title,Price,Publisher,Image FROM book
WHERE Book_ID = '$bookauthorArray[$i]'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
$image = $row["Image"];
echo $image;
echo "<tr>
<td><a href= bookdetails.htm> <img src=
\"$image\" width=125 height=150></a></td> </tr>";
}
}
When the user is redirected to bookdetails.htm, I want the title, price and publisher of the book to be sent to bookdetails.htm, where they will be displayed???
Webfreak
03-24-2004, 11:59 AM
You wan't to get title, price and publisher displayed on bookdetails.htm? I'm newbie in mysql, i can write php scripts, but not for mysql. :( Sorry.
vik_pa
03-24-2004, 12:17 PM
can any one tell me on how i can post the values to bookdetails.htm. will i need to use $_POST ???
vik_pa
03-24-2004, 12:29 PM
ive just realised the situation is more complex. i have to figure out which image the user selects and then post values based on the selected image???