diff --git a/core/model/MySQLDatabase.php b/core/model/MySQLDatabase.php index cd4136141..b57da8dfc 100755 --- a/core/model/MySQLDatabase.php +++ b/core/model/MySQLDatabase.php @@ -1082,7 +1082,7 @@ class MySQLQuery extends SS_Query { public function nextRecord() { // Coalesce rather than replace common fields. - if($data = mysql_fetch_row($this->handle)) { + if(is_resource($this->handle) && $data = mysql_fetch_row($this->handle)) { foreach($data as $columnIdx => $value) { $columnName = mysql_field_name($this->handle, $columnIdx); // $value || !$ouput[$columnName] means that the *last* occurring value is shown