From fdd5e71ba9651106e529e81e3255552ce23d3d3b Mon Sep 17 00:00:00 2001 From: Dominik Beerbohm Date: Mon, 30 Apr 2012 13:44:31 +0300 Subject: [PATCH] ENHANCEMENT: Remove unnecessary NULL check. --- model/MySQLDatabase.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/model/MySQLDatabase.php b/model/MySQLDatabase.php index 659056992..eacf94dca 100644 --- a/model/MySQLDatabase.php +++ b/model/MySQLDatabase.php @@ -1158,18 +1158,10 @@ class MySQLQuery extends SS_Query { 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; }