...

View Full Version : while loop displaying hyperlink[solved]



swissbeets
07-08-2008, 03:39 PM
i have a while loop displaying all of my product information and i want there to be an add to cart hyperlink displaying also, but keeps giving me a parsing error, i have tried many different combinations here is my code

while($row = mysql_fetch_array($product_set)){



echo "<p>";
echo $row['product_name']."<br />";
echo "$".$row['product_price']."<br />"."<br />";
show_picture($row);
?>
echo "<a href=\"shoppingcart.php?prod=".urlencode($row['product_id'])."?action=add\">"."</a>";
<?php
}

am i doing something wrong?

Brandoe85
07-08-2008, 03:45 PM
You are breaking out of php with ?> and then trying to echo....take out the ?> and <?php before the }.

swissbeets
07-08-2008, 03:50 PM
when i do this nothing is displayed at all, it just skips right over that and shows the names, description and pictures

Brandoe85
07-08-2008, 04:09 PM
Because you don't have anything in the a tag:


echo "<a href=\"shoppingcart.php?prod=".urlencode($row['product_id'])."?action=add\">something here"."</a>";

swissbeets
07-08-2008, 04:29 PM
i knew it was something small thank you very much



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum