Quantcast
Channel: PHPDeveloper.org
Viewing all articles
Browse latest Browse all 11

Johannes Schluter's Blog: MySQLi Resultset Iterator

$
0
0

Johannes Schluter has posted a look at a handy little script that shows an interface between the returned MySQLi results and an SPL iterator.

When using MySQLi's multi_query to send queries which return multiple result sets you have to use a rather unintuitive API which can certainly be improved. Recently I sat down and cooked up a small improvement for that, being an iterator fan I, of course, had to use an iterator for that and implemented the following class.

The class extends the standard Iterator and provides the interfaces to work through the results of the query in your choice of Iterator-supporting looping structure. Example code for the class and its usage are both included.


Viewing all articles
Browse latest Browse all 11

Trending Articles