Answer the question
In order to leave comments, you need to log in
How to initialize custom mysql variable in Laravel 4?
I want to execute a query with the @total variable:
SET @total = 0;
SELECT ...
@total := @total + x AS total_x,
...
WHERE
@total < 1000
DB::statement( DB::raw( 'SET @total := 0'));
$results = DB::select( $query); // тут только "select.."
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question