From ff806f9157a4a9b32fb40d38ca2cab8130cf66d2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 16 Mar 2015 17:05:25 +0200 Subject: [ci skip] Polish changes from PR #3669 --- user_guide_src/source/database/query_builder.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'user_guide_src/source/database') diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst index 68ddca717..0a6d98744 100644 --- a/user_guide_src/source/database/query_builder.rst +++ b/user_guide_src/source/database/query_builder.rst @@ -520,18 +520,18 @@ The second parameter lets you set a result offset. Permits you to determine the number of rows in a particular Active Record query. Queries will accept Query Builder restrictors such as -where(), or_where(), like(), or_like(), etc. Example:: +``where()``, ``or_where()``, ``like()``, ``or_like()``, etc. Example:: echo $this->db->count_all_results('my_table'); // Produces an integer, like 25 $this->db->like('title', 'match'); $this->db->from('my_table'); echo $this->db->count_all_results(); // Produces an integer, like 17 -The second paramater is to disable resetting of QB values. Example:: +However, this method also resets any field values that you may have passed +to ``select()``. If you need to keep them, you can pass ``FALSE`` as the +second parameter:: - echo $this->db->count_all_results('my_table'); // Produces an integer, like 25 - $this->db->like('title', 'match'); - echo $this->db->count_all_results(); // Produces an integer, like 17 + echo $this->db->count_all_results('my_table', FALSE); **$this->db->count_all()** @@ -1097,9 +1097,10 @@ Class Reference Prepends a database prefix, if one exists in configuration. - .. php:method:: count_all_results([$table = '']) + .. php:method:: count_all_results([$table = '', [$reset = TRUE]]) :param string $table: Table name + :param bool $reset: Whether to reset values for SELECTs :returns: Number of rows in the query result :rtype: int -- cgit v1.2.3-24-g4f1b