Could some please help me. I am following a tutorial from "http://www.devarticles.com/c/a/MySQL/Building-A-Persistent-Shopping-Cart-With-PHP-and-MySQL/2/"

I keep getting a "
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\cart1\products.php on line 59"

My db connection is fine but I am trying bring a result from the diagram shown in the url. Please help. This is what I have put in my code from the site the products page.

<?php

// This page will list all of the items
// from the items table. Each item will have
// a link to add it to the cart

include("db.php");

// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$result = mysql_query("select * from items order by itemName asc");

?>
<?php
while($row = mysql_fetch_array($result))
{
?>
<html>
<head>
<title>Products</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table>
<tr>
<td width="30%" height="25">
<font face="verdana" size="1" color="black">
<?php echo $row["itemName"]; ?>
</font>
</td>
    <td width="10%" height="25"> <font face="verdana" size="1" color="black"> <?php echo $row["itemPrice"]; ?> 
      </font> </td>
<td width="50%" height="25">
<font face="verdana" size="1" color="black">
<?php echo $row["itemDesc"]; ?>
</font>
</td>
<td width="10%" height="25">
<font face="verdana" size="1" color="black">
<a href="cart.php?action=add_item&id=<?php echo $row["itemId"]; ?>&qty=1">Add Item</a>
</font>
</td>
</tr>
<tr>
<td width="100%" colspan="4">
<hr size="1" color="red" NOSHADE>
</td>
</tr>
<tr>
<td width="100%" colspan="4">
<font face="verdana" size="1" color="black">
<a href="cart.php">Your Shopping Cart &gt;&gt;</a>
</font>
</td>
</tr>
</table>
</body>
</html>

If that is all the code from the page it is because you forgot the closing curley brace } for the while loop

If that is all the code from the page it is because you forgot the closing curley brace } for the while loop

Thanks would anyone know where i can get info on how to display information from a database or retrieve info for my items and display them on the page

Well have a look on php.net as there are alot of user submitted examples and walkthroughs that will be able to help you

This article has been dead for over six months. Start a new discussion instead.