summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/query_builder.rst
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2015-04-06 18:59:53 +0200
committerAhmad Anbar <aanbar@gmail.com>2015-04-06 18:59:53 +0200
commit5e50c42ef27261bc7fcb279499ce76cfc2519aa6 (patch)
treed74d660534b72ddc0b6cda9147cecfb64a225346 /user_guide_src/source/database/query_builder.rst
parented520408514fff6486788e1543589418d24d885e (diff)
parent7726b75552f765af94038e47a4a4272ac08c646e (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'user_guide_src/source/database/query_builder.rst')
-rw-r--r--user_guide_src/source/database/query_builder.rst19
1 files changed, 13 insertions, 6 deletions
diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst
index fa1e90353..0a6d98744 100644
--- a/user_guide_src/source/database/query_builder.rst
+++ b/user_guide_src/source/database/query_builder.rst
@@ -520,13 +520,19 @@ 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
+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', FALSE);
+
**$this->db->count_all()**
Permits you to determine the number of rows in a particular table.
@@ -1091,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
@@ -1221,7 +1228,7 @@ Class Reference
:param string $key: The field to search
:param array $values: The values searched on
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1232,7 +1239,7 @@ Class Reference
:param string $key: The field to search
:param array $values: The values searched on
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1243,7 +1250,7 @@ Class Reference
:param string $key: Name of field to examine
:param array $values: Array of target values
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1254,7 +1261,7 @@ Class Reference
:param string $key: Name of field to examine
:param array $values: Array of target values
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object