I'm making use of the function to retrieve one value from the table,
public ArrayList selectValue(SQLiteDatabase sqliteDB, String contactEmail){
Cursor c = sqliteDB.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE ContactEmail='"+contactEmail+"'",null);
if (c != null ) {
if (c.moveToFirst()) {
do {
double contactId = c.getDouble(c.getColumnIndex("ContactId"));
results.add("ContactEmail: " +contactEmail+ ",ContactId: " + contactId);
}while (c.moveToNext());
}
}
return results;
}
But the above function retrieves all the values from the table.. Not sure what is wrong with the query..
I also tried hardcoding the value like this,
Cursor c = sqliteDB.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE ContactEmail='[email protected]'",null);
but this also gives all the rows. Am I missing something here?? Please help
Thanks for your response folks.. I fixed the problem..
This is how I changed the code and got it worked,
Thanks again!! Have a great day!!