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='peter@peter.com'",null);
but this also gives all the rows. Am I missing something here?? Please help