I'm trying to create a shopping cart system for estore on my website but I'm having trouble getting anything to work. I started out by creating a file to display my products from the database but they aren't showing up. Its supposed to display the name, price, and description for each product but it just says name, price, and description instead of the actual information. Here's the code:
<?php
session_start();
include ('config.php');
$itemCount = 0;
if(isset($_SESSION['cart']));
$itemCount= count (isset($_SESSION['cart']) ? $_SESSION['cart'] : array() );
}
?>
<html>
<head>
</head>
<ul>
<li><a href="index1.php">Home</a></li>
<li><a href="cart1.php">View cart</a></li>
<li> { <?php echo $itemCount; ?> } </li>
</ul>
<p class= "msg">
<?php if(isset($_REQUEST['msg'])) {
switch($_REQUEST['msg']):
case 'add':
$msg = $_REQUEST['p'] . " was added to your cart.";
break;
endswitch;
echo $msg;
}
?>
<h2>Products</h2>
<ul>
<li>Name</li>
<li>Price</li>
<li>Description</li>
</ul>
<?php
$prod =mysql_query($db, "SELECT * FROM 'Products' ");
while($r = mysql_fetch_array($db)){
extract($r);
?>
<div>
<div class="inline-pr"><?=$productName?></div>
<div class="inline-pr"><?=$price?></div>
</div>
</body
</html>