00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 if (!function_exists('mysql_connect'))
00021 trigger_error('mysql_* functions not defined. Install php*-mysql.', E_USER_ERROR);
00022 require_once(dirname(__FILE__) . '/KjwResultSet.php');
00023
00028 class KjwMyResultSet extends KjwResultSet {
00029 var $_resource;
00030 var $_pointer;
00031 var $_end;
00038 function KjwMyResultSet(&$resource) {
00039 parent::KjwResultSet();
00040 $this->_resource = &$resource;
00041 $this->_pointer = 0;
00042 $this->_end = mysql_num_rows($this->_resource);
00043 }
00044
00045
00046 function destroy() {
00047 mysql_free_result($this->_resource);
00048 parent::destroy();
00049 }
00050
00051
00052 function getNext() {
00053 if ($this->_pointer < $this->size()) {
00054 ++$this->_pointer;
00055 return mysql_fetch_assoc($this->_resource);
00056 }
00057 return false;
00058 }
00059
00060
00061 function at() {
00062 return $this->_pointer;
00063 }
00064
00065
00066 function size() {
00067 return $this->_end;
00068 }
00069
00070
00071 function seekAbs($offset) {
00072 if ($offset >= 0 && $offset < $this->_end) {
00073 $this->_pointer = $offset;
00074 mysql_data_seek($this->_resource, $offset);
00075 return true;
00076 }
00077 return false;
00078 }
00079 }
00080
00081 ?>