Hey friends,
I have written the code for fetching id and password from sqlite database. When I remove password fetching statement it works fine but if I write password fetching statement and run the app, that doesn't works for me.
Without password fetching this works fine, but I have to fetch password for confirming that an id is existing in SQLite database, here is the code,
please see and suggest.
I have written the code for fetching id and password from sqlite database. When I remove password fetching statement it works fine but if I write password fetching statement and run the app, that doesn't works for me.
Without password fetching this works fine, but I have to fetch password for confirming that an id is existing in SQLite database, here is the code,
please see and suggest.
Java:
SQLiteDatabase db = dbHelper.getReadableDatabase();
Student student = new Student();
Cursor cursor = db.query(Student.TABLE, new String[] {Student.KEY_ID, Student.KEY_password}
, Student.KEY_ID + "=?",
new String[] { id }, null, null, null, null);
if (cursor.getCount() == 0){
loginTest = false;
}
if (cursor.moveToFirst()){
cursor.getString(cursor.getColumnIndex(Student.KEY_password));
return true;
}
return loginTest;