From 5f8c0c1f638c40f56251b1f805336dbd5f80e19f Mon Sep 17 00:00:00 2001 From: yaoshanliang <1329517386@qq.com> Date: Sat, 14 Mar 2015 12:44:18 +0800 Subject: add a judgment of whether reset select --- system/database/DB_query_builder.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 79cbfb3ad..894d7ddb5 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,10 @@ 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) { -- cgit v1.2.3-24-g4f1b