//根据名字来修改年龄
-(void)changeStudentAge:(NSInteger)age withName:(NSString *)name
{
NSString *changesql = [NSString stringWithFormat:@"UPDATE 'student' SET age = %ld WHERE name = '%@' ",age,name];
int result = sqlite3_exec(db,changesql.UTF8String,NULL,NULL);
if (sqlITE_OK == result) {
NSLog(@"修改成功");
}
else
{
NSLog(@"修改失败");
}
}
原文链接:https://www.f2er.com/sqlite/199299.html