My record: (ID, name, count)
(1, 1, 2)
(2, t, 10)
It works: myDbHelper.updateCount("1", 100);
It didn't work: myDbHelper.updateCount("t", 100); It gave android.database.sqlite.SQLiteException:no such column: t: , while compiling: ...
Here is the code for updating records:
public int updateCount(String name, int count) {
ContentValues args = new ContentValues();
args.put(KEY_COUNT, count);
return mDb.update(DATABASE_TABLE, args, KEY_NAME + "=" + name, null);
}