prepare("delete from orderproduct where product = ? and `order` = cart(?)"); $statement->bind_param("ii", $_POST['product_id'], $user_id); $statement->execute(); $cart_count = get_cart_count(); break; } case "add": { // ik wou deze functie eigenlijk in een stored procedure doen maar het // schijnt dat de knappe koppen bij mysql het geen goed idee vonden om // gewoon 'return' toe te staan binnen de body van een stored // procedure??? $statement = $cursor->prepare("select add_to_cart(?, ?)"); $statement->bind_param("ii", $_POST['product_id'], $user_id); $statement->execute(); $statement->get_result()/*->fetch_object()*/; $cart_count = get_cart_count(); break; } case "update": { $statement = $cursor->prepare("update orderproduct set count = ? where product = ? and `order` = cart(?)"); $statement->bind_param("iii", $_POST['count'], $_POST['product_id'], $user_id); $statement->execute(); return; // update requests are only triggered from JS and don't do anything with the response } } } while (false); ?> image ? "/img/product/$item->id-thumb.jpg" : "/img/placeholder.png"; echo <<<"EOF"