-
-
Save parzibyte/dbe0c2657c811fb4a4b72aab08f106ec 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 eliminarProducto($id) | |
{ | |
$bd = obtenerConexion(); | |
$sentencia = $bd->prepare("DELETE FROM productos WHERE id = ?"); | |
return $sentencia->execute([$id]); | |
} | |
function guardarProducto($nombre, $precio, $descripcion) | |
{ | |
$bd = obtenerConexion(); | |
$sentencia = $bd->prepare("INSERT INTO productos(nombre, precio, descripcion) VALUES(?, ?, ?)"); | |
return $sentencia->execute([$nombre, $precio, $descripcion]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment