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 $
$
This is not bug, you provide two parameters for only one placeholder.
$sql->execute(array(':username',$username));
should be
$sql->execute(array(':username' => $username));