summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-03-16 16:05:25 +0100
committerAndrey Andreev <narf@devilix.net>2015-03-16 16:05:25 +0100
commitff806f9157a4a9b32fb40d38ca2cab8130cf66d2 (patch)
tree872afc1cc67f4b846691a5a7c0e19128d865e18c /user_guide_src/source/database
parent00e34370e1f235b09e49adfa28f21c8fa3a41778 (diff)
[ci skip] Polish changes from PR #3669
Diffstat (limited to 'user_guide_src/source/database')
-rw-r--r--user_guide_src/source/database/query_builder.rst13
1 files changed, 7 insertions, 6 deletions
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