I am trying to create a shopping cart with three php files. I created the db.php. However, when I try to run the products.php I am receving the following error message:
Parse error: parse error, unexpected $ in /afs/umbc.edu/users/a/n/andrade1/pub/www/is448/project6-1/products.php on line 58
I don't understand how I can get an error message for line 58 when I only have 57 lines in my code.
<?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))
{
?>
<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 >></a>
</font>
</td>
</tr>
</table>
</body>
</html>