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.imag e_id, dollsimage.imag e_date
FROM dollsimage, dolls
WHERE dollsimage.imag e_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_arr ay($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&i id=$image_id$ga meandtoyname$pr icetype'></a> ";
}
print $str;
}
?>
[/PHP]
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.imag e_id, dollsimage.imag e_date
FROM dollsimage, dolls
WHERE dollsimage.imag e_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_arr ay($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&i id=$image_id$ga meandtoyname$pr icetype'></a> ";
}
print $str;
}
?>
[/PHP]
Comment