-
-
Save parzibyte/e4149e47f7981ecf7222512e27cd9d8e 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 agregarProductoAlCarrito($idProducto) | |
{ | |
// Ligar el id del producto con el usuario a través de la sesión | |
$bd = obtenerConexion(); | |
iniciarSesionSiNoEstaIniciada(); | |
$idSesion = session_id(); | |
$sentencia = $bd->prepare("INSERT INTO carrito_usuarios(id_sesion, id_producto) VALUES (?, ?)"); | |
return $sentencia->execute([$idSesion, $idProducto]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment