setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) {die('Could not connect to the Saint database:
' . $e);} ## Get Items In Cart ----------------------------------- $sql="SELECT * FROM CartItems WHERE UserID='$member' AND OrderNo='0' ORDER BY Date"; //$sql="SELECT * FROM CartItems ORDER BY Date"; //echo "$sql"; try { // Prepare statement $result = $db->prepare($sql); $result->execute(); } catch(PDOException $e){ echo $sql . "
" . $e->getMessage();} $num=$result->rowCount(); //echo "Number in cart ".$num; if ($num == "0") { echo "Your shopping cart is empty "; } else { # format Contents Display --------------------------- echo "Your shopping cart contains the following items:
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } $subtotal=0; while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $ItemsID=$row['ItemID']; $saint=str_replace('4x6','', $ItemsID); $saint=str_replace('5x7','', $saint); $saint=str_replace('8x10','', $saint); $prettyItemsID=str_replace('4x6',' 4x6', $ItemsID); $prettyItemsID=str_replace('5x7',' 5x7', $prettyItemsID); $prettyItemsID=str_replace('8x10',' 8x10', $prettyItemsID); $prettyItemsID=str_replace('sanl','San L', $prettyItemsID); $prettyItemsID=str_replace('stv',' St. V', $prettyItemsID); $prettyItemsID=str_replace('sta',' St. A', $prettyItemsID); $ItemQuantity=$row['ItemQuantity']; $CartItemsID=$row['CartItemsID']; $Itemsize=$row['ItemCategory']; $ItemCost=$row['ItemCost']; $Itemtotal=$ItemCost*$ItemQuantity; echo ""; $subtotal=$subtotal+$Itemtotal; } ?>
Thumbnail"; echo "Product Name"; echo ""; echo "Qty"; echo ""; echo "Cost"; echo ""; echo "Item Total"; echo "
saint thumbnail$prettyItemsID$ItemQuantity"; include("Quantity.php"); echo "$ItemCost$Itemtotal