Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 13, 2021 18:50
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/dbe0c2657c811fb4a4b72aab08f106ec to your computer and use it in GitHub Desktop.
Save parzibyte/dbe0c2657c811fb4a4b72aab08f106ec to your computer and use it in GitHub Desktop.
<?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