Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: max(two, seven)?
(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