1

This code returns total number of rows. Where as i want the number of rows with username and password entered by user.

public boolean logInUser(String un,String pass){
    int row;
    SQLiteDatabase db = getReadableDatabase();
    String query = "SELECT * FROM USER WHERE USERNAME = '" + un + "' AND PASSWORD = '" + pass + "'";
    Cursor c = db.rawQuery(query, null);
    row=c.getCount();
    return row > 0;
}
Kushal Sharma
  • 5,978
  • 5
  • 25
  • 41
saima
  • 11
  • 1

0 Answers0