Skip to content Skip to sidebar Skip to footer

Laravel Selectraw Vs Db:raw

First: DB::table('someTable') ->selectRaw('count(*), min(some_field) as someMin, max(another_field) as someMax') ->get(); Second: DB::table('someTable')->select( array(

Solution 1:

As per Laravel's documentation:

Note: The Laravel query builder uses PDO parameter binding to protect your application against SQL injection attacks. There is no need to clean strings being passed as bindings.

Post a Comment for "Laravel Selectraw Vs Db:raw"