diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index bec616c9c5..36a38ac062 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->query('SELECT * FROM tbl_post'); + * $command = $connection->createCommand('SELECT * FROM tbl_post'); + * $reader = $command->query(); * * while ($row = $reader->read()) { * $rows[] = $row;