1
public void updateEntry(String eMail, String password)
{
// Define the updated row content.
ContentValues updatedValues = new ContentValues();
// Assign values for each row.
updatedValues.put("EMAIL", eMail);
updatedValues.put("PASSWORD", password);
String where = "EMAIL = ?";
db.update("LOGIN", updatedValues, where, new String[] { eMail });
}
我只能更新我的密碼(我創建了四個字段名稱,密碼,電子郵件,電話)。這個可以嗎?更新Android上sqllite的具體數值
,如果你只想要更改您的密碼,那麼你並不需要爲您的電子郵件做到這一點。你可以刪除這一行updatedValues.put(「EMAIL」,eMail); – xFighter
其餘的,如果EMAIL是唯一的,那麼這似乎是正確的(如果你採取xFighter建議)。 – AxelH