Skip to content

Instantly share code, notes, and snippets.

@cebe
Created June 7, 2013 06:54
Show Gist options
  • Save cebe/5727488 to your computer and use it in GitHub Desktop.
Save cebe/5727488 to your computer and use it in GitHub Desktop.
Getting all rows of Yii AR
<?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