hi there,
I am writing a login screen for android. i have managed to create the database and inserted some users. My problem now is i want to query the database when the user clicks on login from the main menu.
What the query needs to do is check whether the username typed by the user exists in the database. I am having some problems with this and all your help is much appreciated.
below is the source code from my DBAdapter class.. thanks very much
//---retrieves a particular user---
public Cursor getUser(String username) throws SQLException
{
Cursor mCursor=db.rawQuery("SELECT name FROM" +DATABASE_NAME+"WHERE user_name="+username+";", null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
When i call this from my main class it just crashes.
Hope to hear form you guys soon
Tunwiir



