我有一個表有數據。如何從表中檢索多個記錄?
id type
1 max
1 sam
1 rom
2 jak
我要檢索的所有type
其中id=1;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSString *aRecord = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
NSLog (@"%@",aRecord);
}
這一說法retrive我只有最後一條記錄。我如何獲得所有記錄?
how to catch these records in the variable. I am using aRecord but it store only last record. So this is the main concern
使用包裝。它非常容易:http://github.com/ccgus/fmdb或http://github.com/schwa/TouchSQL – 2010-08-30 15:43:09