lundi 21 décembre 2015

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(
        DB::raw('min(some_field) as someMin'),
        DB::raw('max(another_field) as someMax'),
        DB::raw('COUNT(*) as `count`')
    )
)->get()

The above two query result is same , but my question is there any possible security issues(SQL injections) with these two queries if i use user inputs directly in where conditions.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire