I have made a simple registration form in which i have called function insertMember()
with parameters. When i debug this method it shows all the values correct while i put values in ContentValues()
but when it comes at the end db.insert(MEMBER, null, values)
it shows password value as email and does not show password field value. Where i am wrong here? Any suggestions please.
gender=Male lastname=Ras firstname=Tab contact=021111111 email=123
Code
public void insertMember(String fname,String lname, String email,String password,String contact,String gender)
{
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(M_FNAME, fname);
values.put(M_LNAME, lname);
values.put(M_EMAIL, email);
values.put(M_EMAIL, password);
values.put(M_CONTACT, contact);
values.put(M_GENDER, gender);
long MemberId = db.insert(MEMBER, null, values);
Cursor cursor = db.query(MEMBER, MEMBER_COLUMNS, M_ID + " = " + MemberId, null, null, null, null);
boolean success = cursor.moveToFirst();
if (success) {
cursor.close();
db.close();
}
}
Aucun commentaire:
Enregistrer un commentaire