title: How to initialize user-defined MySQL variables in Laravel 4?
body: <p>Query I want to run needs to initialize a <code>@total</code> variable:</p>
  
  <pre><code>SET @total = 0;
  SELECT ...
      @total := @total + x AS total_x,
      ...
  WHERE
      @total &lt; 1000
  ...
  </code></pre>
  
  <p>Query works when tested via pma, but I fail to run it through Laravel. Tried putting both statements into single <code>DB::select( $query)</code> call, and running two consequent calls:</p>
  
  <pre><code>DB::statement( DB::raw( 'SET @total := 0'));
  $results = DB::select( $query); // only the "select.." part here
  </code></pre>
  
  <p>What's the workaround here?</p>