title: PDO Query Check for Duplicate Username Upon Submission
body: <p><strong>ERROR: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 7</strong></p>
  
  <p>Trying to use <code>PDO</code> to make this connection and form the query that checks for a username if it exists or not upon input into field after submit is pressed. </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;form action="inc/check_regUsr.php" method="post" id="userLogon"&gt;
      &lt;div class="field required"&gt;
          Username: &lt;input type="text" name="regduser" tabindex="1" /&gt;&lt;br /&gt;
          &lt;/div&gt;
          &lt;div class="field required"&gt;
          Password: &lt;input type="password" name="regdpass" tabindex="2" /&gt;&lt;br /&gt;
          &lt;/div&gt;
          &lt;input type="submit" name="submitUser" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  #Login Details
  require_once('dbcred.php');
  $conn = new PDO("mysql:host=$host;dbname=$db", $user, $pass);
  
  #Check for Existing User
  $q = $conn-&gt;query("SELECT uname FROM Student WHERE $_POST['regduser'] = uname");
  $stmt = $conn-&gt;prepare($q);
  $r-&gt;execute($q);
  if($q($r)&gt;= 1){ #if there are 1 or more users with enter username, deny.
  echo "Sorry, username already exists";
  }
  else{
  echo "Success";
  }
  
  ?&gt;
  </code></pre>