dimanche 30 août 2015

android sql update not working

try {
        open();
        ContentValues values = new ContentValues();
        values.put(column_name, value);
        database.beginTransaction();
        database.update(MySQLiteHelper.TABLE_NAME, values, MySQLiteHelper.COLUMN_ID + " = " + whereClause,null);
        database.setTransactionSuccessful();
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        database.endTransaction();
    }
    close();

The previous code would be equal to this query :

UPDATE options SET instant = 0 WHERE _id = 1

But the change is never applied. I check the table before and after the update but the values are the same, can anyone suggest anything?

Aucun commentaire:

Enregistrer un commentaire