Commit 1773ae53 by Qiang Xue

Merge pull request #2802 from Skyh13/yii2-docs-2340

Update usage example in comments of db\DataReader
parents b4fd5b5c 44116c7c
...@@ -17,7 +17,8 @@ use yii\base\InvalidCallException; ...@@ -17,7 +17,8 @@ use yii\base\InvalidCallException;
* iterating through the reader. For example, * 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()) { * while ($row = $reader->read()) {
* $rows[] = $row; * $rows[] = $row;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment