you can query the database again and then check the results, or you can store everything in a session the first time around, then check what the user submitted against the session data, and make your update query from that.
http://www.php.net/session