I code my php in PHP Coder, it has a great function called \'find matching brace\' . If goes all the way down your script, you know you forgot one.
When the error tells you it\'s the last line of your code, or the one before, it is always a missing brace, or you forgot ?> .
Just a tip...
One more thing, you might want to use
.... password = PASSWORD($password) WHERE... etc.
It encrypts the password. You don\'t want to know all your friends / clients passwords now do you?
When they log in, just match it like this:
SELECT COUNT(*) FROM user_table WHERE password = PASSWORD($password) AND user_name = \'$user_name\'
Good practise for privacy in your coding..