阅读(2629)
赞(21)
Laravel 8 使用命名绑定
2021-07-06 17:45:05 更新
除了使用 ? 表示参数绑定外,你还可以使用命名绑定的形式来执行一个查询:
$results = DB::select('select * from users where id = :id', ['id' => 1]); 除了使用 ? 表示参数绑定外,你还可以使用命名绑定的形式来执行一个查询:
$results = DB::select('select * from users where id = :id', ['id' => 1]);