I have a database entry that I need to update.
This method obviously doesn’t work, but it should help explain what Im trying to do.
public void updateEntry(String user, String message, String mentions, String og) {
ContentValues args = new ContentValues();
args.put(KEY_MESSAGE, message);
args.put(KEY_MENTIONS, mentions);
this.db.update(ENTRY_TABLE, args, ("message = ?", "username = "+user), new String[] {og});
}
I need to update the entry where the “name” column AND the “message” column both match the input values.
The database has multiple entries with the same user, and may have multiple entires with the same message but different user, so multiple where clauses are necessary.
How can I use two (or more) where clauses in an sql query?
this change should work..