Why this code returns false?

```
$db = new \PDO('mysql:host=localhost;dbname=apimanager;charset=utf8', 'root', '');      
$q = $db->prepare("select * from tbl_user where username=:u and password=:p");
$q->bindParam(':u',$username,\PDO::PARAM_STR);
$q->bindParam(':p',$password,\PDO::PARAM_STR);
$stmt = $q->fetchAll();     

if(count($stmt)>0)
    return(true);
else
    return(false);

```