if(m_database.connect(GameServer.getDatabaseHost(), GameServer.getDatabaseUsername(), GameServer.getDatabasePassword())) {
if(m_database.selectDatabase(GameServer.getDatabaseName())) {
ResultSet result = m_database.query("SELECT * FROM pn_members WHERE username='" + MySqlManager.parseSQL(username) + "'");
try {
if(result.first()){
// if we got a result, compare their old password to the one we have stored for them
if(result.getString("password").compareTo(oldPassword) == 0) {
// old password matches the one on file, therefore they got their old password correct, so it can be changed to their new one
m_database.query("UPDATE pn_members SET password='" + MySqlManager.parseSQL(newPassword) + "' WHERE username='" + MySqlManager.parseSQL(username) + "'");
// tell them their password was changed successfully