4 V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
5 Released under both BSD license and Lesser GPL library license.
6 Whenever there is any discrepancy between the two licenses,
7 the BSD license will take precedence.
13 $rs = $db->Execute("select * from adoxyz");
14 foreach($rs as $k => $v) {
15 echo $k; print_r($v); echo "<br>";
18 Iterator code based on http://cvs.php.net/cvs.php/php-src/ext/spl/examples/cachingiterator.inc?login=2
21 class ADODB_Iterator implements Iterator {
25 function __construct($rs)
31 $this->rs->MoveFirst();
36 return !$this->rs->EOF;
41 return $this->rs->_currentRow;
46 return $this->rs->fields;
51 $this->rs->MoveNext();
54 function __call($func, $params)
56 return call_user_func_array(array($this->rs, $func), $params);
61 return 'ADODB Iterator';
66 class ADODB_BASE_RS implements IteratorAggregate {
67 function getIterator() {
68 return new ADODB_Iterator($this);