which is the fetch function to get an array of value
Posted: Sun Nov 30, 2014 11:20 am
Which is the correct PDOStatement:fetch() function to get an array of values.
Can someone provide an example. Please.
I have tried for about 3 hours trying to fetch an array of values and NOTHING happens.
for instance, I do get the array, but NO values in it, wondering what am I doing wrong?
I tried putting quotes between $table and $database and that does not work.
Can someone provide an example. Please.
I have tried for about 3 hours trying to fetch an array of values and NOTHING happens.
for instance, I do get the array, but NO values in it, wondering what am I doing wrong?
Code: Select all
$query = $this->db_query("SHOW FULL COLUMNS FROM ".$table." FROM ".$database);
$query_array = $query->fetchAll(PDO::FETCH_COLUMN | PDO::FETCH_GROUP, PDO::FETCH_COLUMN);
$query->closeCursor();
echo "query_fetch_results: ";
print_r($query_array);