Forum Moderators: coopster
$getuserdata = mysql_query("SELECT * FROM cart WHERE UserID='$userinfo'");
if ($myproducts = mysql_fetch_array($getuserdata)) {
do {
print('<p>'.$myproducts[Manufacturer].' '.$myproducts[Model].'<a href="cart.php?deleteme='.$myproducts[ID].'">remove item</a>');
} while ($myproducts = mysql_fetch_array($getuserdata));
}
// then in the script where the cart is pointing (or earlier on in same page if it points to itself)...
if (isset($deleteme)){
$deleteitem = mysql_query("DELETE FROM cart WHERE ID='$deleteme'");
}