summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_query_builder.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 79cbfb3ad..3d4a8576c 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1355,7 +1355,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
* @param string
* @return int
*/
- public function count_all_results($table = '')
+ public function count_all_results($table = '', $reset = true)
{
if ($table !== '')
{
@@ -1366,7 +1366,11 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$result = ($this->qb_distinct === TRUE)
? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results")
: $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows')));
- $this->_reset_select();
+
+ if($reset)
+ {
+ $this->_reset_select();
+ }
if ($result->num_rows() === 0)
{