summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
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;