Last active
August 10, 2017 07:42
-
-
Save Danilovonline/86ccfdbd7dc4fb8d529911f134803279 to your computer and use it in GitHub Desktop.
PDO: get list
This file contains 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
//$list = array(); | |
$sql = " | |
select | |
* #fields | |
from | |
table | |
WHERE | |
id = :id | |
"; | |
$query = $this->get('pdo')->prepare($sql); | |
$query->execute(array(':id' => $id)); | |
while ($r = $query->fetch(\PDO::FETCH_ASSOC)) { | |
//$list[$r['id']] = $r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment