我有一个表有数据。如何从表中检索多个记录?
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