When i open my RSS app, i would like to check if an article exists in my database.If it exists,i would like to delete it (or ignore it),if not to write it in the db.
I have been trying to do it something like this:
Cursor cursor = ourDatabase.rawQuery("select 1 from "
+ DBHelper.DATABASE_TABLE + " where " + DBHelper.TITLE + "='"
+ title + "'" + " AND " + DBHelper.DATE + "='" + date + "'",
new String[] {});
if (cursor.moveToFirst()) {
boolean exists = (cursor.getCount() > 0);
cursor.close();
return exists;
} else {
return false; }
}
but i get this error:
06-06 16:01:11.341: E/AndroidRuntime(13867): Caused by: android.database.sqlite.SQLiteException: near "όσο": syntax error (code 1): , while compiling: select 1 from all_t where title='Ο ΦΟΒΟΣ και ο ΤΡΟΜΟΣ των διαδηλωτών!!! Αυτές οι γυναίκες είναι πιο σκληρές απ' όσο δείχνουν!' AND date='Wed, 05 Jun 2013 18:12:15'