Skip to content

Commit

Permalink
Named params examples for queries
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolGoose committed Mar 24, 2015
1 parent 16d43aa commit d8fd835
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions database.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Once you have configured your database connection, you may run queries using the

The `select` method will always return an `array` of results.

You can also run a select query using named prepared statements.

$results = DB::select('select * from users where id = :id', ['id' => 1]);

> **Note:** You can not reuse the same named prepared statement.

#### Running An Insert Statement

DB::insert('insert into users (id, name) values (?, ?)', [1, 'Dayle']);
Expand Down

0 comments on commit d8fd835

Please sign in to comment.