mardi 1 décembre 2015

Android sqlite Cursor.getCount() always return 1

I know Cursor.getCount() returns number of columns that's it . I have written a code i can't see where i am making mistake. Please help me I have wasted 4 hours in it .

Cursor res = db.rawQuery("select count(*) from "+TABLE_NAME+" WHERE SENDERS_EMAIL = '"+email+"' AND FRIENDS_STATUS = 1;",null);

    Log.d("FrindsInDb","FriendExists, count="+res.getCount());

Explanation: case 1: if email = princy@gmail.com , then output -> res.getCount() returns 1 (CORRECT) case 2: if email = princy@gmail.c , then ALSO output -> res.getCount() returns 1 (WHY ?)

in my table under SENDERS_EMAIL, only princy@gmail.com exists

Aucun commentaire:

Enregistrer un commentaire