summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-09-14 04:03:39 +0100
committerJamie Matthews <[email protected]>2010-09-14 04:03:39 +0100
commit674d83234273ee9cf263c1278b96272a0f71e758 (patch)
treeedb6c1f317879e970036793a316c32b6cb171596 /README.markdown
parent80c5136a539050896aa2901abcd91766d622f1e6 (diff)
Add code, tests and docs for inequality operators: where_gt, where_lt, where_gte, where_lte
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 1145928..b44bf45 100644
--- a/README.markdown
+++ b/README.markdown
@@ -105,6 +105,15 @@ To add a `WHERE ... LIKE` clause, use:
$people = ORM::for_table('person')->where_like('Name', '%fred%')->find_many();
+#### Less Than / Greater Than ####
+
+There are four methods available for inequalities:
+
+ * Less than: `$people = ORM::for_table('person')->where_lt('age', 10)->find_many();`
+ * Greater than: `$people = ORM::for_table('person')->where_gt('age', 5)->find_many();`
+ * Less than or equal: `$people = ORM::for_table('person')->where_lte('age', 10)->find_many();`
+ * Greater than or equal: `$people = ORM::for_table('person')->where_gte('age', 5)->find_many();`
+
#### Raw WHERE clauses ####
If you require a more complex query, you can use the `where_raw` method to specify the SQL fragment exactly. This method takes two arguments: the string to add to the query, and an array of parameters which will be bound to the string. The string should contain question marks to represent the values to be bound, and the parameter array should contain the values to be substituted into the string in the correct order.