News Feed
Jobs Feed
Sections




News Archive
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

Stefan Koopmanschap's Blog: GlobIterator: Easy access to specific files

DevShed: Performing Basic Tasks with MySQL 4.1 and Above, using mysqli with PHP 5

DevShed: Using Directory Iterators to Build Loader Apps in PHP

DevShed: Implementing the commit() and rollback() Methods with mysqli and PHP 5

DevShed: Iterators in the Simplest Sense - Traversing Data Structures in PHP 5


Community Events











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


community functional framework podcast opinion interview zendframework2 tool composer conference code release unittest example testing language development object series introduction

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