mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: mysql_fetch_row() expects resource, this will fatal if query was e.g. UPDATE when iterating a result because MySQLQuery::nextRecord() is used by Iterator::valid() and MySQLQuery:: is bool in this case (from r106938)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112543 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f7e61e0d11
commit
a0424ccd3e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user