News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Johannes Schluter's Blog:
MySQLi Resultset Iterator
June 22, 2009 @ 11:12:11

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.

0 comments voice your opinion now!
iterator result mysqli


blog comments powered by Disqus

Similar Posts

Rubayeet Islam's Blog: MySQL Prepared Statements and PHP : A small experiment

SitePoint PHP Blog: Fun with Array Interfaces

Hasin Hayder's Blog: Counting occurrence of a word in a String - Benchmarking of PHP functions

Fabien Potencier's Blog: Iterator or IteratorAggregate?

Andrey Hristov's Blog: Replacing mysqli's Connection, Result and Statement classes


Community Events





Don't see your event here?
Let us know!


release library introduction community wordpress podcast series list code laravel interview threedevsandamaybe configure framework language bugfix api project developer application

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework