icefire Posted June 3, 2010 Share Posted June 3, 2010 can any body tell me what is the problem in this page cuz the products doesnt appear [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/203739-product-page-help/ Share on other sites More sharing options...
beta0x64 Posted June 3, 2010 Share Posted June 3, 2010 <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 https://forums.phpfreaks.com/topic/203739-product-page-help/#findComment-1067078 Share on other sites More sharing options...
icefire Posted June 3, 2010 Author Share Posted June 3, 2010 lol thanx Link to comment https://forums.phpfreaks.com/topic/203739-product-page-help/#findComment-1067084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.