PDO query isn't working

the difference is that @SpacePhoenix wants to count the number of results, so he has to use fetchAll() even if there is only a single result. but counting result rows ain’t necessary at all as @BlackScorp demonstrates.

@BlackScorp yes, Exceptions must be explicitly enabled.
@BlackScorp the LIMIT 1 is not necessary, since emailand password must be a unique (composite) key