Hii人
我试图在插入记录之前检查android中的现有记录。我得到一个异常,当我检查logcat它说它的语法错误。需要一些Urget帮助这些家伙
感谢
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;
答案 0 :(得分:3)
变化:
"SELECT 1 FROM"
到
"SELECT 1 FROM "