android - I want to update an entry in my database -


hi want update entry in db , giving codes updateentry function below..i want update password field have tried not working

 public string updateentry(string password) {     // create object of content values     contentvalues updatedvalues = new contentvalues();     // assign values each item     // updatedvalues.put("username", user_name);     updatedvalues.put("password", password);      string = "password=?";     db.update("logindetails", updatedvalues, where,             new string[] { password });     return password; } 

and code have written update entry :

string passwordnew =logindatabaseadapter.updateentry(confirm_password);      passwordnew=confirm_password; 

where want update password in db confirm_password. need suggestions.

public int updatecontact(int id,string username,string password) {     sqlitedatabase db = this.getwritabledatabase();      contentvalues values = new contentvalues();      values.put(username, username);      values.put(password, password);        // updating row     return db.update(logindetails, values, key_id + " = ?",             new string[] { id });   } 

call database function activity

db.updatecontact("1","dhaval","1234"); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -