svilla 17 Junior Poster in Training

Usually when you get that error message that you listed there is an error with the Query. When mysql_query returns a boolean instead of a result set it has caught some sort of error.

Echo out the mysql_error and and mysql_errno, nonshatter's query should have worked.

You can also try to run the query in phpadmin or some other MySql interface just to make sure it is valid.

karthik_ppts commented: Useful post +4
svilla 17 Junior Poster in Training

I am not sure that it makes sense for a user to be able to change their password from a login screen. It would normally be a function that the user can access after they have logged on.

Once the user is properly logged on, then you can present them the option to change their password.

debasisdas commented: agree +13
svilla 17 Junior Poster in Training

You could save the primary key in hidden fields on the web form after the initial save. If the value of the primary key is null or blanks (which is an invalid value for a primary key) you know that the record needs to be inserted. If it contains a value, you know you need to update the record. This will also ensure that you have the primary key available for the Update process.

The nature of web pages should guarantee that if you navigate away from this page and then back to this page from another page that this will always be true (except, maybe, if they used the back button on the browser).

You could add an extra piece of mind by clearing the primary key field in teh page load when Not Page.IsPostBack.