Query having 2 Where Clause
- by Harsha M V
i am trying to login and want to validate username and password against the records in the database. I am not sure how to pass two Where clause
public Boolean login(String username, String password) throws SQLException {
Cursor mCursor = db.query(TABLE_USERS, new String[] { ID,
KEY_NAME, KEY_USERNAME}, KEY_USERNAME + "="
+ "'"+username+"'", KEY_PASSWORD + "="
+ "'"+password+"'", null, null, null, null, null);
if (mCursor.moveToFirst()) {
return true;
}
return false;
}
Am getting a Syntax Error.