3 * Fetches MySQL database rows as objects
5 class DataAccessResult implements Iterator {
8 * $da stores data access object
13 * $query stores a query resource
21 function DataAccessResult($result) {
22 $this->result = $result;
31 * Returns an array from query row or false if no more rows
35 $row = $this->current();
41 * Returns the number of rows affected
45 if (!isset($this->nb_rows)) {
46 $this->nb_rows = db_numrows($this->result);
48 return $this->nb_rows;
52 * Returns false if no errors or returns a MySQL error message
71 if ($this->_current < $this->rowCount()) {
72 $this->_row = db_fetch_array_by_row($this->result, $this->_current);
79 return $this->_row !== false;
83 if ($this->rowCount() > 0) {
90 return $this->_current;