0
我怎樣才能創建下面的查詢中的Kohana Db的生成器如何在Kohana的查詢生成器創建下面MySQL查詢
SELECT @i:=0;
UPDATE `table_name`
SET `order` = @i:[email protected]+1
where `column_name`= '3337'
我怎樣才能創建下面的查詢中的Kohana Db的生成器如何在Kohana的查詢生成器創建下面MySQL查詢
SELECT @i:=0;
UPDATE `table_name`
SET `order` = @i:[email protected]+1
where `column_name`= '3337'
嘗試單獨的查詢!
$q1 = DB::query(NULL, "SELECT @i:=0");
$q2 = DB::update('table_name')
->set(array('order','=',DB::expr('@i:[email protected]+1')))
->where('column_name','=','3337');
$q1->execute();
$q2->execute();
你已經試過了什麼? – kero