summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown8
1 files changed, 6 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index 74ff2f0..9ebb1b9 100644
--- a/README.markdown
+++ b/README.markdown
@@ -202,12 +202,16 @@ The `limit` and `offset` methods map pretty closely to their SQL equivalents.
##### Ordering #####
-*Note that this method **does not** escape its query parameter and so this should **not** be passed directly from user input.*
+*Note that these methods **do not** escape their query parameters and so these should **not** be passed directly from user input.*
-Two methods are provided to add `ORDER BY` clauses to your query. These are `order_by_desc` and `order_by_asc`, each of which takes a column name to sort by.
+Two methods are provided to add `ORDER BY` clauses to your query. These are `order_by_desc` and `order_by_asc`, each of which takes a column name to sort by. The column names will be quoted.
$people = ORM::for_table('person')->order_by_asc('gender')->order_by_desc('name')->find_many();
+If you want to order by something other than a column name, then use the `order_by_expr` method to add an unquoted SQL expression as an `ORDER BY` clause.
+
+ $people = ORM::for_table('person')->order_by_expr('SOUNDEX(`name`)')->find_many();
+
#### Grouping ####
*Note that this method **does not** escape it query parameter and so this should **not** by passed directly from user input.*