I am using the following query to fetch a row with a particular mid.
Cursor mCursor = mDb.query(true, DATABASE_TABLE, new String[] { KEY_ROWID, "actionData", "mid" }, "mid" + "=" + mid, null, null, null, null, null);
I however get an sqlite exception when I try to do the same. Any ideas?
The exception is –
Error: android.database.sqlite.SQLiteException: no such column: qVEl3: , while compiling: SELECT DISTINCT _id, actionData, mid FROM notifs WHERE mid=qVEl3
You missed the quotations:
So your Android code should be :
(that will prevent SQL injection too)