Answers for "how to fetch all column values php"

PHP
0

how to fetch all column values php

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

/* Obtener todos los valores de la primera columna */
$resultado = $gsent->fetchAll(PDO::FETCH_COLUMN, 0);
var_dump($resultado);
?>
Posted by: Guest on October-28-2021

Code answers related to "how to fetch all column values php"

Browse Popular Code Answers by Language