database = $database; $this->handle = $handle; $this->statement = $statement; } public function __destruct() { if (is_object($this->handle)) $this->handle->free(); // Don't close statement as these may be re-used across the life of this request // if (is_object($this->statement)) $this->statement->close(); } public function seek($row) { if (is_object($this->handle)) return $this->handle->data_seek($row); } public function numRecords() { if (is_object($this->handle)) return $this->handle->num_rows; } public function nextRecord() { if (is_object($this->handle) && ($data = $this->handle->fetch_assoc())) { return $data; } else { return false; } } }