简体   繁体   中英

Android SQlite update query

i have an update query where i need to pass multiple parameter. Please guide how to do. Here in place of "id" i want multiple parameters for example name age.

//Code

   ContentValues updateCountry = new ContentValues();
   updateCountry.put("country_name", "United States");
   db.update("tbl_countries", updateCountry, "id=?", new String[] {Long.toString(countryId)})

Try

   ContentValues updateCountry = new ContentValues();
   updateCountry.put("country_name", "United States");
   db.update("tbl_countries", updateCountry, "id=? AND name=? AND age=?", new String[]{Long.toString(countryId),"name_value","age_value"});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM