Hmmm well CartID should be a number! When an item is added to the shopping cart, the mysql database gives it an automatic number and the column is ct_id.
I have the following on my input form for adding items to the cart.
Code:
<input name="hidCartId[]" type="hidden" value="<?php echo $ct_id; ?>">
<input name="hidProductId[]" type="hidden" value="<?php echo $pd_id; ?>"></td>
which obviously works ok when adding items to the cart and I can update the cart quantities fine if I just keep pressing the add to cart button!! However, once I have gone on to the next page ie, the view shopping cart page and try and do an update from there it all goes pear shaped! Thats when I get the Unknown column error. The delete cart bit works ok
Code:
/*
Remove an item from the cart
*/
function deleteFromCart($cartId = 0)
{
if (!$cartId && isset($_GET['cid']) && (int)$_GET['cid'] > 0) {
$cartId = (int)$_GET['cid'];
}
if ($cartId) {
$sql = "DELETE FROM tbl_cart
WHERE ct_id = $cartId";
$result = dbQuery($sql);
}
header('Location: cart.php');
}
Many thanks
Lizzy
Bookmarks