mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #381 from AngryPHPNerd/patch-2
MINOR: Colliding field check runs twice
This commit is contained in:
commit
a004acfb59
@ -1158,18 +1158,10 @@ class MySQLQuery extends SS_Query {
|
|||||||
public function numRecords() {
|
public function numRecords() {
|
||||||
if(is_object($this->handle)) return $this->handle->num_rows;
|
if(is_object($this->handle)) return $this->handle->num_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function nextRecord() {
|
public function nextRecord() {
|
||||||
if(is_object($this->handle) && $data = $this->handle->fetch_row()) {
|
if(is_object($this->handle) && ($data = $this->handle->fetch_assoc())) {
|
||||||
$output = array();
|
return $data;
|
||||||
$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;
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user