From f9af1ffce3b01e6e87ded22cc5903c0bf253fbc1 Mon Sep 17 00:00:00 2001 From: Sander Marechal Date: Wed, 2 Mar 2011 15:57:19 +0100 Subject: Allow raw queries without parameters This is useful for e.g. MySQL `LOCK TABLE` or SQLite `VACUUM` commands which usually do not require parameters. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 2e6e6b5..74ff2f0 100644 --- a/README.markdown +++ b/README.markdown @@ -297,7 +297,7 @@ The `join` methods also take an optional third parameter, which is an `alias` fo #### Raw queries #### -If you need to perform more complex queries, you can completely specify the query to execute by using the `raw_query` method. This method takes a string and an array of parameters. The string should contain placeholders, either in question mark or named placeholder syntax, which will be used to bind the parameters to the query. +If you need to perform more complex queries, you can completely specify the query to execute by using the `raw_query` method. This method takes a string and optionally an array of parameters. The string can contain placeholders, either in question mark or named placeholder syntax, which will be used to bind the parameters to the query. $people = ORM::for_table('person')->raw_query('SELECT p.* FROM person p JOIN role r ON p.role_id = r.id WHERE r.name = :role', array('role' => 'janitor')->find_many(); -- cgit v1.2.3