String username= edit_username.getText().toString();
String password=edit_password.getText().toString();
cursor=sqLiteDatabase.rawQuery("SELECT*FROM "+DatabaseHelper.TABLE_NAME+ " WHERE " + DatabaseHelper.col_4+ "= AND"+DatabaseHelper.col_5+"",
new String[]{username,password});
显示错误和等号的位置
答案 0 :(得分:1)
由于您使用的是selectionArgs,因此缺少问号。尝试更改此行
DatabaseHelper.col_4+ "= ? AND "+ DatabaseHelper.col_5+"=?"
答案 1 :(得分:0)
"SELECT * FROM "+DatabaseHelper.TABLE_NAME+ " WHERE " + DatabaseHelper.col_4+ "= AND"+DatabaseHelper.col_5+""
我猜你错过了什么。 我们假设TABLE_NAME =“Person”, col_4 = name,col_5 = age
SELECT * FROM Person WHERE name = AND age
你不应该添加像name =“John”和age = 20这样的参数吗?