Jump to content

product page Help!!


icefire

Recommended Posts

<table border="0" cellpadding="2px" width="600px">
	<?php
		$result=mysql_query("SELECT * FROM products");
		while($row=mysql_fetch_array($result)){
	?>
    	<tr>
        	<td><img src="<?php $row['picture'] ?>" /></td>
            <td>   	<b><?php $row['name'] ?></b><br />
            		<?php $row['description'] ?><br />
                    Price:<big style="color:green">$
				<?php $row['price'] ?></big><br /><br />
               <input type="button" value="Add to Cart" onclick="addtocart(<?php $row['serial']?>)" /> 
		</td>
	</tr>
        <tr><td colspan="2"><hr size="1" /></td>

 

You should either use the notation <?php=$row['price']?> or use echo $row['price'], because all this does is reference the variable $row with a key, but not do anything with it. Whatever is echo'd or print'd to the user is what is displayed as HTML. Everything else is processed before the page loads.

 

So yea. Replace those with something sensible!

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.