0
すべての時間が返されません。sqlite3_step(ステートメント)== SQLITE_DONEステートメントが返されません。
-(BOOL)updateProductTable:(NSString *)productid column_shop_Product_quantity:(NSString *) productquantity{
NSLog(@"%@",productid);
NSLog(@"%@",productquantity);
const char *dbpath = [databasepath UTF8String];
if (sqlite3_open(dbpath, &database) == SQLITE_OK)
{
NSString *updateSQL = [NSString stringWithFormat:@"UPDATE ShopProduct set column_shop_Product_quantity=%@ WHERE column_shop_Product_id=%@",productquantity,productid];
NSLog(@"%@",updateSQL);
const char *update_stmt = [updateSQL UTF8String];
if (sqlite3_prepare_v2(database, update_stmt, -1, &statement, nil) == SQLITE_OK)
{
if (sqlite3_step(statement) == SQLITE_DONE)
{
sqlite3_reset(statement);
return YES;
}
else {
return NO;
}
sqlite3_finalize(statement);
}
}
sqlite3_close(database);
return NO;
}