更新android中sqllite的特定值

时间:2016-12-30 12:09:49

标签: android sqlite

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 });
}

我只需更新密码(我创建了四个字段名称,密码,电子邮件,电话)。这没关系吗?

1 个答案:

答案 0 :(得分:0)

根据输入mail_id将密码更新到数据库..可以使用where子句,...