Skip to content

PHP code snippet – How to fetch all column values ?

$gsent = $gbd->prepare("SELECT name, colour FROM fruit");

/* Obtener todos los valores de la primera columna */
$resultado = $gsent->fetchAll(PDO::FETCH_COLUMN, 0);
See also  Java code snippet - How to get path of captured image in android?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.