From 694b5b8ee6a40b57c91be3c5448bc8f5540d32d8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 18 Dec 2007 15:58:03 +0000 Subject: Added count_all_results() function to Active Record. --- user_guide/database/active_record.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'user_guide/database/active_record.html') 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);
// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax) +

$this->db->count_all_results();

+ +

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:

+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
+

$this->db->count_all();

Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

@@ -401,7 +413,6 @@ $this->db->limit(10, 20);
// Produces an integer, like 25 -  

Inserting Data

-- cgit v1.2.3-24-g4f1b