diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index 30aab7ec23..678a383136 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -17,7 +17,8 @@ use yii\base\InvalidCallException; * iterating through the reader. For example, * * ~~~ - * $reader = $command->setSql('SELECT * FROM tbl_post'); + * $command = $connection->createCommand('SELECT * FROM tbl_post'); + * $reader = $command->query(); * * while ($row = $reader->read()) { * $rows[] = $row;