View Full Version : while loop displaying hyperlink[solved]

07-08-2008, 04: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 />";
echo "<a href=\"shoppingcart.php?prod=".urlencode($row['product_id'])."?action=add\">"."</a>";

am i doing something wrong?

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

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

07-08-2008, 05: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>";

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