-
-
Save parzibyte/0564e6e28454edc54680265474500a2d 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 | |
include_once "base_de_datos.php"; | |
$nombre = "Ejemplo"; | |
$edad = 2; | |
/* | |
Al incluir el archivo "base_de_datos.php", todas sus variables están | |
a nuestra disposición. Por lo que podemos acceder a ellas tal como si hubiéramos | |
copiado y pegado el código | |
*/ | |
$sentencia = $base_de_datos->prepare("INSERT INTO mascotas(nombre, edad) VALUES (?, ?);"); | |
$resultado = $sentencia->execute([$nombre, $edad]); # Pasar en el mismo orden de los ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment