IOS SQLIte 数据库操作

NSString* docsDir = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory,NSUserDomainMask,YES) lastObject];

NSString* dbPath = [docsDir stringByAppendingPathComponent:@"people.db"];

FMDatebase* db = [FMDatebase databaseWithPath:dbPath];

FMResultSet* rs = [db executeQuery:@"select * from people"];

if(![db open])

{

return;

}

while ([rs next])

{

[rs stringForColumn:@"firstname"];

[rs stringForColumn:@"lastname"]

}

[db close];


你可能感兴趣的:(ios,数据库,sqlite)