title: PDO - Invalid parameter number
body: <p>Just recently I've switched to using PDO in PHP/MySQL and transformed some dozens of queries. Most of them worked, however this very easy one throws an exception at <code>$sql-&gt;execute()</code></p>
  
  <pre><code>$sql=$pdo-&gt;prepare("SELECT id FROM user WHERE username = :username LIMIT 1");
  $sql-&gt;execute(array(':username',$username));
  </code></pre>
  
  <blockquote>
    <p>PDOStatement::execute() pdostatement.execute SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in ...</p>
  </blockquote>
  
  <p>After research, I found this link: <a href="https://bugs.php.net/bug.php?id=60515" rel="noreferrer">https://bugs.php.net/bug.php?id=60515</a></p>
  
  <p>... and therefore tried to change the query to</p>
  
  <pre><code>$sql=$pdo-&gt;prepare("SELECT `id` FROM `user` WHERE `username` = :username LIMIT 1");
  $sql-&gt;execute(array(':username',$username));
  </code></pre>
  
  <p>But still with the same result. Does anybody see what is obviously wrong or why does this query not work when all others did?</p>
  
  <p>Thank you very much in advance!</p>