Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel where multiple values 
Php :: how to change php variable value in javascript 
Php :: get from table laravel 
Php :: php trim quotes 
Php :: php if in array 
Php :: Add WooCommerce Price Suffix 
Php :: make full laravel model ( with migration, controller and resource ) 
Php :: php convert 
Php :: laravel without global scopes 
Php :: laravel api response json 
Php :: php set title dynamically 
Php :: and php 
Php :: readfile in php 
Php :: check if session is started 
Php :: loop through php array 
Php :: mysqli_connect php 
Php :: php check if a url exists 
Php :: php full form 
Php :: check if given date time is of today or yesterday php 
Php :: laravel observer 
Php :: user location using php 
Php :: wordpress create shortcode 
Php :: laravel where on relationsship column 
Php :: PHP Display Posts by Category in WordPress 
Php :: laravel override factory values in database seeder 
Php :: how to check where function defined in php 
Php :: replace text in string php 
Php :: laravel get age from date 
Php :: php .= 
Php :: phpmyadmin 403 forbidden centos 6 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =