_resource instanceof PDOStatement) { try { $mode = $this->named ? PDO::FETCH_NAMED : PDO::FETCH_NUM; if ($result = $this->_resource->fetch($mode)) { $this->_key = $this->_iterator; $this->_current = $this->_cache[$this->_iterator++] = $result; return true; } } catch (PDOException $e) {} } $this->_resource = null; return false; } public function __destruct() { $this->close(); } } ?>