1$someVariable = Input::get("some_variable");
2$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = :somevariable"), array(
3 'somevariable' => $someVariable,
4 ));
5
6DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=:incrementStart', array('incrementStart' => 9999) );
1use Illuminate\Support\Facades\DB;
2
3$users = DB::select('select * from users');
4
5foreach ($users as $user) {
6 echo $user->name;
7}
1DB::statement('UPDATE users SET role_id = 1 WHERE role_id IS NULL AND YEAR(created_at) > 2020');