-
-
Save parzibyte/9c707be2c99eb59e15e8a6993c645ed4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function obtenerProductosEnCarrito() | |
{ | |
$bd = obtenerConexion(); | |
iniciarSesionSiNoEstaIniciada(); | |
$sentencia = $bd->prepare("SELECT productos.id, productos.nombre, productos.descripcion, productos.precio | |
FROM productos | |
INNER JOIN carrito_usuarios | |
ON productos.id = carrito_usuarios.id_producto | |
WHERE carrito_usuarios.id_sesion = ?"); | |
$idSesion = session_id(); | |
$sentencia->execute([$idSesion]); | |
return $sentencia->fetchAll(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment