title: Parse error: syntax error, unexpected (T_VARIABLE)
body: <p>I am executing some queries and am getting the following the error:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '$section2' (T_VARIABLE) on line
    22</p>
  </blockquote>
  
  <p>Line 22 is:</p>
  
  <pre><code>$section2 = $db-&gt;prepare("INSERT INTO learning_style_scores VALUES (5,12,4)");
  </code></pre>
  
  <p>I don't have a clue why I am getting this, I have checked my syntax and all seems to be correct. It basically doesn't like anything after the <code>$section1</code> query is executed</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I understand this is prone to SQL injection but I am doing it like this for testing purposes only.</p>
  
  <pre><code>&lt;?php
      session_start();
  
      try {
      $db = new PDO("mysql:dbname=questionnaire;host=localhost", "root", ""); 
      $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
      }
  
  
      catch(Exception $e)
      {
      echo 'Caught exception: ',  $e-&gt;getMessage(), "\n";
      }
  
  
      $session = md5(session_id());
  
      // insert section1 data into database
      $section1 = $db-&gt;prepare('INSERT INTO section1 VALUES (7,"test")');
  
      $section1-&gt;execute();​
  
  
      // insert learning style score into database
      $section2 = $db-&gt;prepare("INSERT INTO learning_style_scores VALUES (5,12,4)");
  
      $section2-&gt;execute();​
      ?&gt;
  </code></pre>