次には一回目のアップデータができますが、二回目には、アップデータがなかなかできませんので、よろしくお願いできますか。
次にはデーターベースが書いてありますが、ご参照のほどよろしくお願いします。
-(BOOL)updateAt1:(int)index{
[self openDatabase];
BOOL success = YES;
[database beginTransaction];
[database executeUpdate:@"update JPTestN4Gram set checkon = ? where rowid = ?", @"check1.png", [NSNumber numberWithInt:index]];
[database commit]; if ([database hadError]) { NSLog(@"Err %d: %@", [database lastErrorCode], [database lastErrorMessage]); success = NO; } return success; bool count=NO; [database beginTransaction]; [database setShouldCacheStatements:YES]; count = [database intForQuery:@"select count(*) from JPTestN4Gram where checkon='check1.png'"]; if (count){ for (NSInteger i=1; i<count; i++){ [database executeUpdate:@"update JPTestN4Gram set No1=? where where checkon='check1.png' order by rowid",[NSNumber numberWithInteger:i]]; if(!count){ count=NO; } } } [database commit]; return count; }
あなたの回答
tips
プレビュー