Skip to content

Commit 83a6ee0

Browse files
committed
Update README.
1 parent 0484608 commit 83a6ee0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,22 @@ $DB->closeConnection();
245245
Iterator
246246
------------
247247

248-
**Use an iterator** when you want to read thousands of data from the database for statistical or full update of Elastic Search or Solr indexes.
248+
**Use iterator** when you want to read thousands of data from the database for statistical or full update of Elastic Search or Solr indexes.
249249

250-
An iterator is a traversable object that does not read all the data queried from MySQL into memory.
250+
[Iterator](https://secure.php.net/manual/en/class.iterator.php) is a traversable object that does not read all the data queried from MySQL into memory.
251251

252252
So you can safely use `foreach` to handle millions of MySQL result sets without worrying about excessive memory usage.
253253

254254
Example:
255255

256256
```php
257-
$it = $DB->iterator("SELECT * FROM fruit limit 0, 1000000;");
257+
$iteratorInstance = $DB->iterator("SELECT * FROM fruit limit 0, 1000000;");
258258
$colorCountMap = array(
259259
'red' => 0,
260260
'yellow' => 0,
261261
'green' => 0
262262
);
263-
foreach($it as $key => $value) {
263+
foreach($iteratorInstance as $key => $value) {
264264
sendDataToElasticSearch($key, $value);
265265
$colorCountMap[$value['color']]++;
266266
}

0 commit comments

Comments
 (0)