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  Python code snippet - How to add list toa key in ict?

Leave a Reply

Your email address will not be published. Required fields are marked *

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