Here's the code snippet I am currently using:
function decrementCart(quantity, id){
db.transaction(function(tx){
tx.executeSql("UPDATE cart SET quantity=(quantity -1) WHERE id=?", [id])
});
}
I'm encountering an issue where the quantity goes into negative numbers after reaching 0. Can someone provide guidance on how to prevent this from happening? Any help would be greatly appreciated!