📜  laravel 中带参数的原始查询 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.398000             🧑  作者: Mango

代码示例1
$someVariable = Input::get("some_variable");
$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = :somevariable"), array(
   'somevariable' => $someVariable,
 ));

DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=:incrementStart', array('incrementStart' => 9999) );