好的,这不是垃圾邮件,应该很简单我不知道为什么它不起作用这是我的代码:
gamesdatabase = openOrCreateDatabase("GamesDatabase", MODE_PRIVATE, null);
gamesdatabase.execSQL("CREATE TABLE IF NOT EXISTS Games (ID INTEGER PRIMARY KEY, Name
VARACHAR, NPlayers INT(1), NRounds INT(2), WinScore INT(2));");
gamesdatabase.execSQL("INSERT INTO Games
(ID, Name, NPlayers, NRounds, WinScore ) VALUES ( NULL, 'TAWLA',2,0,0 );");
gamesdatabase.execSQL("INSERT INTO Games
(ID, Name, NPlayers, NRounds, WinScore ) VALUES ( NULL, 'DOMANA',4,0,0 );");
Cursor c = gamesdatabase.rawQuery("SELECT * FROM Games", null);
c.moveToFirst();
while (c.isAfterLast() == false) {
Log.d("BEZRA", String.valueOf(c.getInt(c.getColumnIndex("ID"))));
c.moveToNext();
}
这有什么问题?日志显示所有记录为 0