I want to execute the query with the @total variable:
SET @total = 0; SELECT ... @total := @total + x AS total_x, ... WHERE @total < 1000 Through phpMyAdmin request works. The laravel problem. Tried and in one call: DB::select( DB::raw( $query)) , and in two consecutive:
DB::statement( DB::raw( 'SET @total := 0')); $results = DB::select( $query); // тут только "select.." Chyadt?