sqlite3 数据操作 修改
sqlite3 * db = [Database openDB];
sqlite3_stmt * stmt = nil;
NSString * sqlstring = [NSString stringWithFormat:@"update Student set name = ‘%@‘ where id = %ld" , name , (long)ID];
int result = sqlite3_prepare_v2(db, [sqlstring UTF8String], -1, &stmt, NULL);
if (result == SQLITE_OK) {
if (sqlite3_step(stmt) == SQLITE_DONE) {
sqlite3_finalize(stmt);
[Database closeDB];
return YES;
}
}
sqlite3_finalize(stmt);
[Database closeDB];
return NO;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。