Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Jan 13, 2021
Embed
What would you like to do?
<?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