Your Shopping cart

"; $stuff = sybase_query("select * from cart WHERE custid = \"$custid\" AND itemid = \"$additem\"", $connection); $row = sybase_fetch_array($stuff); if ($row) { /* adding more than one of an item */ $num = $row["quan"] + 1; sybase_query("update cart SET quan=$num WHERE custid = \"$custid\" AND itemid = \"$additem\"", $connection); } else { sybase_query("INSERT into cart VALUES (\"$custid\", \"$additem\", 1)", $connection); } } if ($delete) { sybase_query("DELETE from cart WHERE itemid = \"$delete\"", $connection); } $allitems = sybase_query("SELECT trainitems.itemid, productname, price, quan FROM trainitems, cart WHERE cart.custid = \"$custid\" AND cart.itemid = trainitems.itemid"); if (sybase_num_rows($allitems) != 0) { $total = 0; print ""; print ""; print ""; print ""; print ""; while ($row = sybase_fetch_array($allitems)) { print ""; print ""; print ""; print ""; print ""; print ""; $total += $row[price] * $row[quan]; } print ""; print ""; print "
IDProductPrice#Subtotal
$row[itemid]$row[productname]\$$row[price]$row[quan]\$" . $row[quan]*$row[price]. "Remove
Total:\$$total
"; } else { print "Cart empty.. go buy something!

"; } sybase_close($connection); ?>

Continue Shopping!