ConFoo Montreal 2026: Call for Papers

Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

simplerezo at gmail dot com
8 years ago
I still don't understand why FETCH_KEY_PAIR is not documented here (http://php.net/manual/fr/pdo.constants.php), because it could be very useful!

<?php
var_dump
($pdo->query('select id, name from table')->fetchAll(PDO::FETCH_KEY_PAIR));
?>

This will display:
array(2) {
[2]=>
string(10) "name2"
[5]=>
string(10) "name5"
}

<< Back to user notes page

To Top