Created
September 17, 2013 07:23
-
-
Save cetver/6591021 to your computer and use it in GitHub Desktop.
Yii PDO::FETCH_GROUP
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 | |
$sth = Yii::app()->getDb()->getPdoInstance()->prepare(' | |
SELECT | |
when_created, | |
type_id, | |
amount | |
FROM rates | |
WHERE employee_id = :employee_id | |
'); | |
$sth->execute(array( | |
':employee_id' => $employee_id | |
)); | |
$rows = $sth->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC); | |
vd($rows); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment