Jump to content

A problem with listening items


Jacbey

Recommended Posts

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 :)

Link to comment
https://forums.phpfreaks.com/topic/245821-a-problem-with-listening-items/
Share on other sites

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.