I have a login page which I have added a number of error messages. However there is one set which I just cant get to work. The set at the bottom of the post provide when the button is pressed however they do not compare the what is being entered against what is in the database.

I'm trying to check if the email address in the database, the password matches and if the character 'Y' is in the "accountconfirmed" column.

Can anyone advise how I can finish these error messages off or why the are displayed as soon as the page is viewed?