Permalink
Browse files

ENHANCEMENT: Remove unnecessary NULL check.

  • Loading branch information...
1 parent 0e8c3ac commit fdd5e71ba9651106e529e81e3255552ce23d3d3b @beerbohmdo beerbohmdo committed Apr 30, 2012
Showing with 3 additions and 11 deletions.
  1. +3 −11 model/MySQLDatabase.php
View
14 model/MySQLDatabase.php
@@ -1158,18 +1158,10 @@ public function 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_row()) {
- $output = array();
- $this->handle->field_seek(0);
- while($field = $this->handle->fetch_field()) {
- $columnName = $field->name;
- if(isset($data[$this->handle->current_field-1]) || !isset($output[$columnName])) {
- $output[$columnName] = $data[$this->handle->current_field-1];
- }
- }
- return $output;
+ if(is_object($this->handle) && ($data = $this->handle->fetch_assoc())) {
+ return $data;
} else {
return false;
}

0 comments on commit fdd5e71

Please sign in to comment.