PHPackages                             antevenio/pdo-mysql-select-iterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. antevenio/pdo-mysql-select-iterator

ActiveLibrary[Database &amp; ORM](/categories/database)

antevenio/pdo-mysql-select-iterator
===================================

PHP PDO Mysql select statement iterator implemented as multiple queries using LIMIT clauses

0.1.14(3y ago)620.9k↓67.9%2[1 issues](https://github.com/Antevenio/pdo-mysql-select-iterator/issues)1MITPHPPHP &gt;=5.6

Since Feb 23Pushed 3w ago4 watchersCompare

[ Source](https://github.com/Antevenio/pdo-mysql-select-iterator)[ Packagist](https://packagist.org/packages/antevenio/pdo-mysql-select-iterator)[ Docs](https://github.com/Antevenio/pdo-mysql-select-iterator)[ RSS](/packages/antevenio-pdo-mysql-select-iterator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (22)Used By (1)

pdo-mysql-select-iterator
=========================

[](#pdo-mysql-select-iterator)

[![Latest Stable Version](https://camo.githubusercontent.com/6b425e3bec60aa123f2289b977df95612825e5f31332dd982b0a1136b63a37d4/68747470733a2f2f706f7365722e707567782e6f72672f616e746576656e696f2f70646f2d6d7973716c2d73656c6563742d6974657261746f722f762f737461626c65)](https://packagist.org/packages/antevenio/pdo-mysql-select-iterator)[![Total Downloads](https://camo.githubusercontent.com/e99fc1548667b664cdbedd40cc258d30904b2f6b36dbe764c3baa52d40e9552f/68747470733a2f2f706f7365722e707567782e6f72672f616e746576656e696f2f70646f2d6d7973716c2d73656c6563742d6974657261746f722f646f776e6c6f616473)](https://packagist.org/packages/antevenio/pdo-mysql-select-iterator)[![License](https://camo.githubusercontent.com/1c90eff5ba55c099e113807fedef03f8222dd8c0ca70d29ed74ebe11706fbe6e/68747470733a2f2f706f7365722e707567782e6f72672f616e746576656e696f2f70646f2d6d7973716c2d73656c6563742d6974657261746f722f6c6963656e7365)](https://packagist.org/packages/antevenio/pdo-mysql-select-iterator)[![Build Status](https://camo.githubusercontent.com/96902719fb77e30ad24351562ac17b6ff345ee846b45d3512bccd56e92e28b6a/68747470733a2f2f7472617669732d63692e6f72672f416e746576656e696f2f70646f2d6d7973716c2d73656c6563742d6974657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Antevenio/pdo-mysql-select-iterator)[![Code Climate](https://camo.githubusercontent.com/6547337cb724da6981c827b608a5622f833543b0bf19310b2351d50efd1c85d4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f416e746576656e696f2f70646f2d6d7973716c2d73656c6563742d6974657261746f722e706e67)](https://codeclimate.com/github/Antevenio/pdo-mysql-select-iterator)

PHP PDO Mysql select statement iterator implemented as multiple queries using LIMIT clauses.

What is this thing
------------------

[](#what-is-this-thing)

So, you want to iterate through millions of table rows coming as a result of some MySQL select query because you want to do your thingie with them, but alas!, your lovely database admin doesn't like queries that stay for too long running in his server, or even worse, the server itself isn't able to hold them!. What do we do?, we do issue several queries that would fetch smaller blocks of rows in place.

This is an just a PHP iterator based on this concept. Upon receiving a SELECT query and a PDO database connection, an iterator is built so you can seamlessly traverse results without having to worry about anything else.

Install
-------

[](#install)

To add as a dependency using composer:

`composer require antevenio/pdo-mysql-select-iterator`

Usage example
-------------

[](#usage-example)

```
