diff options
Diffstat (limited to 'user_guide/database')
-rw-r--r-- | user_guide/database/active_record.html | 13 |
1 files changed, 12 insertions, 1 deletions
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->db->like('title', 'match');<br />
+$this->db->from('<var>my_table</var>');<br />
+echo $this->db->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"> </a>
<h1>Inserting Data</h1>
|