Created
June 7, 2013 06:54
-
-
Save cebe/5727488 to your computer and use it in GitHub Desktop.
Getting all rows of Yii AR
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 | |
// loads an array of MyModel instances | |
$records = MyModel::model()->findAll(); | |
foreach($records as $record) { | |
// $record represents one row in the database | |
print_r($record->attributes); // attributes are the columns/values | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment