4

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)})
askedFeb 21, 2012 at 6:36
Programmer's user avatar

1 Answer1

16

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"});
answeredFeb 21, 2012 at 6:45
user936414's user avatar
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.