Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 13, 2021 19:27
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/efb254d6186cfd258737b3f5b6616ff8 to your computer and use it in GitHub Desktop.
Save parzibyte/efb254d6186cfd258737b3f5b6616ff8 to your computer and use it in GitHub Desktop.
<?php
function obtenerIdsDeProductosEnCarrito()
{
$bd = obtenerConexion();
iniciarSesionSiNoEstaIniciada();
$sentencia = $bd->prepare("SELECT id_producto FROM carrito_usuarios WHERE id_sesion = ?");
$idSesion = session_id();
$sentencia->execute([$idSesion]);
return $sentencia->fetchAll(PDO::FETCH_COLUMN);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment