Jacbey Posted August 27, 2011 Share Posted August 27, 2011 Hi Guys, I am trying to get the while function to list four of my items on a row however I have no idea how and every time I try, I fail. Please give me a hand? Here is the code I have so far if($row['photo'] == "#no_photo") $photo = ('<img src="images/item_pictures/default_item.png" width="150" height="150" alt="Default Item">'); else $photo = $row['photo']; echo "<br /> <br />" ; echo "<br /> <font face='Comic Sans MS, cursive'>Click on an item to view it in full.</font> <br /> <br />"; if($row['photo'] == "#no_photo") $photo = ('<img src="images/item_pictures/default_item.png" width="100" height="100" alt="Default Item">'); else $photo = $row['photo']; echo "<br /> <br />" ; $i = 0; while ($i < $num) { $f1 = "<tr><td><font size='6'><a href='item.php?id=" . mysql_result($result,$i,"item_id") . "'>" . mysql_result($result,$i,"item_name") . "</a></font></td><td> " . $photo . "</td></tr>"; echo "" . $f1 ."" ; $i++; Thanks, Jacbey Quote Link to comment https://forums.phpfreaks.com/topic/245821-a-problem-with-listening-items/ Share on other sites More sharing options...
sunfighter Posted August 27, 2011 Share Posted August 27, 2011 you have too many writing errors in your code. you forget to echo stuff. Please recode and please give values to strings . Your $num is never defined. This line should be echoed and values assigned: <a href='item.php?id=".mysql_result($result, $i, "item_id")."'>".mysql_result($result, $i, "item_name")."</a> Quote Link to comment https://forums.phpfreaks.com/topic/245821-a-problem-with-listening-items/#findComment-1262645 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.