我是安卓新手。
我只是想针对 DB 中的特定用户计算表中的行数(uid 是 db 中的列)。
为此,我做了以下功能:
public int getCount(int uid)
{
String query = "select count(*) from "+TABLE_MESSAGES+ " WHERE uid=?";
Cursor c = ourDB.rawQuery(query,uid);
}
但它给了我错误:
SQLiteDatabase 类型中的方法 rawQuery(String, String[]) 不适用于参数 (String, int)
还想知道我怎样才能从中返回计数?
请帮我。