I would like to update only address and phone in sqlite. How can i solve the db.update?
My KEY_ID always is 1 because im only having one row in database
public void updatecontact(String address, String phone){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_ADDRESS, address);
values.put(KEY_PHONE, phone);
String userid="1";
return db.update(TABLE_LOGIN, values, KEY_ID "= userid", null);
}
What should i do in this to correct it inwhereClause and whereArgs?
return db.update(TABLE_LOGIN, values, whereClause, whereArgs);
do it possible to use KEY_EMAIL = KEY_EMAIL?
Aucun commentaire:
Enregistrer un commentaire