The database configuration file is app/config/database.php
where you can define the connection details, as well as some other options.
You can run queries using the DB
class.
$users = DB::select('select * from users where id = ?', array(1));
The select
method will always return an array of results.
DB::insert('insert into users (id, email) values (?, ?)', array(1, '[email protected]'));
DB::update('update users set email = "[email protected]" where id = ? limit 1', array(1));
DB::delete('delete from users where id = ?', array(1));
DB::statement('drop table users');