Created
July 30, 2015 18:29
-
-
Save RusAlex/6f771f281e5c59c91f84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pdo = new PDO( | |
'mysql:host=localhost;dbname=yiitest', | |
'', | |
'' | |
); | |
$sth = $pdo->prepare("SELECT * FROM bit_values"); | |
$sth->execute(); | |
$r = $sth->fetchAll(PDO::FETCH_ASSOC); | |
echo '<pre>'; var_dump($r); echo '</pre>'; die(); | |
/** | |
array(2) { | |
[0]=> | |
array(2) { | |
["id"]=> | |
string(1) "1" | |
["val"]=> | |
string(1) "" | |
} | |
[1]=> | |
array(2) { | |
["id"]=> | |
string(1) "2" | |
["val"]=> | |
string(1) "" | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment