summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authoryaoshanliang <1329517386@qq.com>2015-03-14 05:44:18 +0100
committeryaoshanliang <1329517386@qq.com>2015-03-14 05:44:18 +0100
commit5f8c0c1f638c40f56251b1f805336dbd5f80e19f (patch)
tree2b4ac473a01ec699a08bbd8a8f120512aa8f68db /system/database
parentac9e63a411e6c6f0d994cf8c6c64bce7155cb9b6 (diff)
add a judgment of whether reset select
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_query_builder.php7
1 files changed, 5 insertions, 2 deletions
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)
{