|
PHP Version:4.3.9 win32
Problem: I try to print the image from table dollsimage , gameandtoyname and the pricetype from dolls. (i have 7 images and 7 gameandtoyname), but This code prints only 3 borders.
What i am doing wrong? i think the problem is with the $str.
Pleas help!
[PHP]
<?php
$sql = ("SELECT gameandtoyname, pricetype, dollsimage.image_id, dollsimage.image_date
FROM dollsimage, dolls
WHERE dollsimage.image_id = dolls.image_id
ORDER BY image_date DESC");
$result = mysql_query ($sql, $conn);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
$str = "";
if (mysql_num_rows($result) > 0)
{
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$i++;
$image_id = $row["image_id"];
$gameandtoyname = $row["gameandtoyname"];
$pricetype = $row["pricetype"];
$str .="$i. <img border='1' height='90' width='100' src='imagedolls.php?act=view&iid=$image_id$gameand toyname$pricetype'></a> ";
}
print $str;
}
?>
[/PHP]
|