summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2007-12-18 16:58:03 +0100
committerDerek Allard <derek.allard@ellislab.com>2007-12-18 16:58:03 +0100
commit694b5b8ee6a40b57c91be3c5448bc8f5540d32d8 (patch)
treee79f794d18e31113ef086d76772c49c81b6b3cf1 /user_guide
parent04036f33f6af540ce371b1ebd1878018f0816ed8 (diff)
Added count_all_results() function to Active Record.
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/changelog.html1
-rw-r--r--user_guide/database/active_record.html13
2 files changed, 13 insertions, 1 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index a47d3a019..5028032b2 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -77,6 +77,7 @@ Change Log
<li>Added <kbd>reduce_multiples()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
<li>Added <kbd>quotes_to_entities()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
<li>Added <kbd>form_reset()</kbd> function to <a href="./helpers/form_helper.html">form helper</a>.</li>
+ <li>Added <kbd>count_all_results()</kbd> function to <a href="./database/active_record.html">Active Record</a>.</li>
<li>Added a language entry for valid_ip validation error.</li>
<li>Added a third parameter to Active Record's like() clause to control where the wildcard goes. </li>
<li>Moved the safe mode and auth checks for the Email library into the constructor. </li>
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index 1c4783ab9..d608459e4 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -392,6 +392,18 @@ $this->db->limit(10, 20);<br />
// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)</code>
+<h2>$this->db->count_all_results();</h2>
+
+<p>Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:</p>
+<code>echo $this->db->count_all_results('<var>my_table</var>');<br />
+
+// Produces an integer, like 25<br />
+<br />
+$this-&gt;db-&gt;like('title', 'match');<br />
+$this-&gt;db-&gt;from('<var>my_table</var>');<br />
+echo $this-&gt;db-&gt;count_all_results();<br />
+// Produces an integer, like 17 </code>
+
<h2>$this->db->count_all();</h2>
<p>Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:</p>
@@ -401,7 +413,6 @@ $this->db->limit(10, 20);<br />
// Produces an integer, like 25</code>
-
<a name="insert">&nbsp;</a>
<h1>Inserting Data</h1>