0
DB::table('someTable')
->selectRaw('count(*), min(some_field) as someMin, max(another_field) as someMax')
->get();
二:
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()
以上兩種查詢的結果是一樣的,但我的問題是有沒有 可能存在的安全問題(SQL注入)與這兩個查詢如果我 直接使用用戶輸入在哪裏條件。
請提供一個例子 – xAoc