summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-04-12 01:14:03 +0100
committerJamie Matthews <[email protected]>2010-04-12 01:14:03 +0100
commit42c375b7524cdb81cddccdd4715ae79ee94730a1 (patch)
tree39ffa291d8765c83e8eebc173b6f697af46b0aff /README.markdown
parent634861d67eb26f2cacd90d420cc876287ae3210a (diff)
Added support for COUNT queries
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index eb46608..9a83783 100644
--- a/README.markdown
+++ b/README.markdown
@@ -87,6 +87,12 @@ To find all records where the `gender` is `female`:
$females = ORM::for_table('person')->where('gender', 'female')->find_many();
+#### Counting results ####
+
+To return a count of the number of rows that would be returned by a query, call the `count()` method.
+
+ $number_of_people = ORM::for_table('person')->count();
+
#### WHERE clauses ####
The `where` method on the ORM class adds a single `WHERE` clause to your query. The method may be called (chained) multiple times to add more than one `WHERE` clause. All the `WHERE` clauses will be `AND`ed together when the query is run. Support for `OR`ing `WHERE` clauses is not currently present; if a query requires an `OR` operator you should use the `where_raw` or `raw_select` methods (see below).