I'm sure this is going to be another of my "ask for help and then realise I was being moronic" posts, but I have a very strange problem with one of my scripts:
Ok, the problem is when I use the correct login details, both the True and the False parts of the script are run. It logs me in and then sends me back to the login page with an error telling me I entered the wrong details.

I have verified that the script is correctly receiving the entered password (hashed) and the password stored on the database (also hashed) and they are exactly the same.
I've also tried this with seperate IF statements instead of an IF ELSE statement, but I get the same problem.