Reputation: 59
Hii guys
Im trying to check for an existing record in android before inserting a record. i get an exception and when i check the logcat it says its a syntax error. need some Urget help with this guys
thanks
DbConnection dbConnection = new DbConnection(EnterDetails.this);
db = dbConnection.getReadableDatabase();
Cursor cursor = db.rawQuery("SELECT 1 FROM" + DbConnection.TABLE + " WHERE "+ DbConnection.C_MNUMBER + " = " +EditTextMobileNumber.getText().toString().trim(),null);
boolean flag = (cursor.getCount() > 0);
Toast.makeText(EnterDetails.this,"Record Found",Toast.LENGTH_LONG).show();
return false;
Upvotes: 0
Views: 786