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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.