Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Jan 13, 2021
Embed
What would you like to do?
<?php
function quitarProductoDelCarrito($idProducto)
{
$bd = obtenerConexion();
iniciarSesionSiNoEstaIniciada();
$idSesion = session_id();
$sentencia = $bd->prepare("DELETE FROM carrito_usuarios WHERE id_sesion = ? AND id_producto = ?");
return $sentencia->execute([$idSesion, $idProducto]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment