I have an array of statistics where I keep the statistics of each level, letter.
ContentValues valors = new ContentValues();
valors.put("user_id", id);
valors.put("letra", "b");
valors.put("jugadas", 0);
valors.put("errores", 0);
valors.put("acertada", 0);
valors.put("tiempo", 0);
baseDatos.getWritableDatabase().insert("estadisticas", null, valors);
The problem I have is I modify that data. Although the increase does not change the number 0 put initially.
public void incrementarJugadas(String letra, int user_id) {
String sql = "UPDATE Estadisticas SET jugadas= jugadas+1 WHERE user_id= " + user_id + " AND letra='" + letra+"'";
getReadableDatabase().execSQL(sql);
this.getWritableDatabase().insert("estadisticas", null, valores);}
}
Does anyone know what's wrong? I have another previous level, where I use the same mechanism and it does work, but in this, for more times than I call increasingJugadas, it always returns the 0 that I put in initial.