你需要确保所有的进程
NSString *query = @"delete from places where published = 1";
const char *sqlStatement = [query UTF8String];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
// Read the data from the result row
NSLog(@"result is here");
}
// Release the compiled statement from memory
sqlite3_finalize(compiledStatement);
}
int numberOfEffectedRow = sqlite3_changes(database);
return numberOfEffectedRow; // get number of effected rows
你是如何确定表中的条目数? – 2009-11-08 11:17:49
例如,我在做 FMResultSet * rs = [database executeQuery:@“select * from tableName”]; ,然后将结果存储在NSMutableArray中。 – MAX 2009-11-08 11:27:53