alert('Error occurred!'); "; } else { header('Location: ../cart.php'); // Redirect after successful deletion } $total = "UPDATE user_buyer SET cart_total_price = cart_total_price - ('$subtotal_price' * '$quantity') WHERE u_id='$uid'"; $res = mysqli_query($conn, $total); if (!$res) { echo ""; } exit(); } else { header('Location: ../cart.php'); // Redirect if booking_id is not set exit(); } ?>