So looks like the query returns 0 result,
Lets start looking at your code:
First are you sure that this condition is true for your user:
Code:
confirmcode='y'
.
Also did you use md5 to encrypt the password in registration?