diff options
Diffstat (limited to 'modules/database/classes/driver/mysql/result.php')
-rw-r--r-- | modules/database/classes/driver/mysql/result.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/database/classes/driver/mysql/result.php b/modules/database/classes/driver/mysql/result.php new file mode 100644 index 0000000..0fbb645 --- /dev/null +++ b/modules/database/classes/driver/mysql/result.php @@ -0,0 +1,47 @@ +<?php + +/** + * Database result implementation for Mysqli + */ +class Result_Mysql_Driver extends Result_Database { + + /** + * Initializes new result object + * + * @param mysqli_result $result Mysqli Result + * @return void + * @access public + * @link http://php.net/manual/en/class.mysqli-result.php + */ + public function __construct($result) { + $this->_result = $result; + $this->_row=$this->_result->fetch_object(); + } + + /** + * Throws exception if rewind is attempted. + * + * @return void + * @access public + * @throws Exception If rewind is attempted + */ + public function rewind() { + if($this->_position!=0) + throw new Exception('Mysqli result cannot be rewound for unbuffered queries.'); + } + + /** + * Iterates to the next row in the result set + * + * @return void + * @access public + */ + public function next() { + + $this->_position++; + $this->_row=$this->_result->fetch_object(); + if ($this->_row == null) + $this->_result->free(); + } + +}
\ No newline at end of file |