我在使用以下代码更新sqlite数据库时遇到问题。任何想法,这里可能有什么问题?
SQLiteDatabase db = openOrCreateDatabase("MyDB2", MODE_PRIVATE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS MyTable (Id VARCHAR, BetSum VARCHAR, Bet VARCHAR, Bank VARCHAR, Previous VARCHAR);");
Cursor cursor = db.rawQuery("SELECT COUNT(*) FROM MyTable;", null);
cursor.moveToFirst();
int count = cursor.getInt(0);
if (cursor.getInt(0)==0)
{
ContentValues newValues = new ContentValues();
newValues.put("Previous","717");
db.update("MyTable", newValues, "id=1", null)
}
}