diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index b53b08952..ccd49b34d 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -238,7 +238,7 @@ class Mysql extends DboSource { * @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch */ public function fetchResult() { - if ($row = $this->_result->fetch()) { + if ($row = $this->_result->fetch(PDO::FETCH_NUM)) { $resultRow = array(); foreach ($this->map as $col => $meta) { list($table, $column, $type) = $meta; diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index b9bf3933b..2be926d24 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -707,7 +707,7 @@ class Postgres extends DboSource { * @return array */ public function fetchResult() { - if ($row = $this->_result->fetch()) { + if ($row = $this->_result->fetch(PDO::FETCH_NUM)) { $resultRow = array(); foreach ($this->map as $index => $meta) { diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index d69d288c9..2d441d7a6 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -330,7 +330,7 @@ class Sqlite extends DboSource { * @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch */ public function fetchResult() { - if ($row = $this->_result->fetch()) { + if ($row = $this->_result->fetch(PDO::FETCH_NUM)) { $resultRow = array(); foreach ($this->map as $col => $meta) { list($table, $column, $type) = $meta; diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index bf9439356..c0e1aa948 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -607,7 +607,7 @@ class Sqlserver extends DboSource { * @return mixed */ public function fetchResult() { - if ($row = $this->_result->fetch()) { + if ($row = $this->_result->fetch(PDO::FETCH_NUM)) { $resultRow = array(); foreach ($this->map as $col => $meta) { list($table, $column, $type) = $meta;