Skip to content

Instantly share code, notes, and snippets.

Created Feb 12, 2019
What would you like to do?
include_once "base_de_datos.php";
$consulta = "SELECT * FROM personas";
# Preparar sentencia e indicar que vamos a usar un cursor
$sentencia = $base_de_datos->prepare($consulta, [
# Ejecutar sin parámetros
# fecthObject va a devolver null alguna vez, cuando eso pase termina
# el ciclo
while ($persona = $sentencia->fetchObject()) {
// Aquí trabajar con persona, p.ej. $persona->nombre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment