0
什麼是或Laravel 5.2如何調用存儲過程或觸發器在Laravel 5.2
什麼是或Laravel 5.2如何調用存儲過程或觸發器在Laravel 5.2
觸發創建存儲過程
DB::unprepared("create PROCEDURE `updateTotal`
(IN `rate` int,IN `qty` int, IN `id` int)
BEGIN
set @total := (rate * qty);
set @id := id;
UPDATE products set total = @total where id = @id;
END");
調用程序的方法來調用存儲過程
DB::statement("CALL updateTotal('50', '5', '47')");
結果更新: w.r.t id 47