title: MySQL Access violation in Laravel that works in phpmyadmin
body: <p>I've just started using Laravel Framework and found a nice little guide for hierarchical-data (through this site) that I have working quite well.</p>
  
  <p>The only problem I've come across is running the following code through Laravel:</p>
  
  <pre><code>DB::query("LOCK TABLE pages WRITE;
          SELECT @myLeft := lft FROM pages WHERE id = ?;
          UPDATE pages SET rgt = rgt + 2 WHERE rgt &gt; @myLeft;
          UPDATE pages SET lft = lft + 2 WHERE lft &gt; @myLeft;
          UNLOCK TABLES;", 1);
  </code></pre>
  
  <p>Works fine when I run the command through phpmyadmin but in Laravel I get an error:</p>
  
  <pre><code>SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
  </code></pre>
  
  <p>I have many other queries running fine, so I don't know where to begin looking, I've already tried adding ` to the table and field names, and removed the locks to see if that would do anything but no change.</p>