From 1ba01ef786b05add23031f5d063f09f49438ae5e Mon Sep 17 00:00:00 2001 From: gwoo Date: Mon, 11 Aug 2008 14:42:37 +0000 Subject: [PATCH] fixes #5227, adodb fetch row git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7451 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo/dbo_adodb.php | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index dd63d1ec1..8f17fe4c6 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -425,19 +425,25 @@ class DboAdodb extends DboSource { * @return unknown */ function fetchResult() { - if (!empty($this->results) && $row = $this->results) { - $resultRow = array(); - $fields = array_keys($row); - $count = count($fields); - $i = 0; - for ($i = 0; $i < $count; $i++) { //$row as $index => $field) { - list($table, $column) = $this->map[$i]; - $resultRow[$table][$column] = $row[$fields[$i]]; - } - return $resultRow; + if (!empty($this->results)) { + $row = $this->results; } else { + $row = $this->_result->FetchRow(); + } + + if (empty($row)) { return false; } + + $resultRow = array(); + $fields = array_keys($row); + $count = count($fields); + $i = 0; + for ($i = 0; $i < $count; $i++) { //$row as $index => $field) { + list($table, $column) = $this->map[$i]; + $resultRow[$table][$column] = $row[$fields[$i]]; + } + return $resultRow; } /**