Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 13, 2021 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f031cfe4d4a8c5eb6c9617d09efefee7 to your computer and use it in GitHub Desktop.
Save parzibyte/f031cfe4d4a8c5eb6c9617d09efefee7 to your computer and use it in GitHub Desktop.
<?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