summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorDaniel Hunsaker <danhunsaker@gmail.com>2013-03-04 10:04:25 +0100
committerDaniel Hunsaker <danhunsaker@gmail.com>2013-03-04 10:04:25 +0100
commite5d7af508680afced4c96b5a52a054c73b6c537e (patch)
tree133b6f7791b975bfc6ecb017ba3a8d862cdecb6c /system/database
parent3b5b7f48848d098c6190781f8790a1b0dcb0217c (diff)
parent5780d8b2078126f8eb5738658fceadd38c66fe5b (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/exit-status
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_result.php9
-rw-r--r--system/database/DB_utility.php4
2 files changed, 5 insertions, 8 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index a044fd5dc..41a851777 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -478,12 +478,9 @@ class CI_DB_result {
return NULL;
}
- if (isset($result[$this->current_row + 1]))
- {
- ++$this->current_row;
- }
-
- return $result[$this->current_row];
+ return isset($result[$this->current_row + 1])
+ ? $result[++$this->current_row]
+ : NULL;
}
// --------------------------------------------------------------------
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 9822fdaa3..9f953d4ac 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -238,7 +238,7 @@ abstract class CI_DB_utility {
$out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim;
}
- $out = rtrim($out).$newline;
+ $out = substr(rtrim($out), 0, -strlen($delim)).$newline;
// Next blast through the result array and build out the rows
while ($row = $query->unbuffered_row('array'))
@@ -247,7 +247,7 @@ abstract class CI_DB_utility {
{
$out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure.$delim;
}
- $out = rtrim($out).$newline;
+ $out = substr(rtrim($out), 0, -strlen($delim)).$newline;
}
return $out;