I am trying to create a simple login form where I compare the login ID and password entered on the login screen with what is stored in the database.
I am using the following query:
final String DATABASE_COMPARE = "select count(*) from users where uname=" + loginname + "and pwd=" + loginpass + ");" ;
The problem is that I do not know how I can fulfill the above request and save the returned invoice.
This is what the database table looks like (I managed to create the database successfully using the execSQl method)
private static final String DATABASE_CREATE = "create table users (_id integer autoincrement, " + "name text not null, uname primary key text not null, " + "pwd text not null);";//+"phoneno text not null);";
Can someone kindly explain to me how I can achieve this? If possible, provide a sample snippet to complete the above task.
android sqlite count
arun Mar 05 2018-11-11T00: 00Z
source share