result = $rs; $this->row_count = $rs->getRecordCount(); } function rewind() { $this->pos = 0; } function valid() { return ($this->pos < $this->row_count); } function key() { return $this->pos; } function current() { if (!isset($this->result->cache[$this->pos])) { $this->result->cache[$this->pos] = $this->result->fetch(PDO::FETCH_ASSOC); } return $this->result->cache[$this->pos]; } function next() { $this->pos++; } function seek($index) { $this->pos = $index; } function count() { return $this->row_count; } }