sqlite3 数据操作 删除



sqlite3 * db = [Database openDB];
    
    sqlite3_stmt * stmt = nil;
    
    NSString * sqlString = [NSString stringWithFormat:@"delete from Student where id = %d",ID];
    int result = sqlite3_prepare_v2(db, [sqlString UTF8String], -1, &stmt, nil);
    
    if (result == SQLITE_OK) {
        if (sqlite3_step(stmt) == SQLITE_DONE) {
            
            sqlite3_finalize(stmt);
            [Database closeDB];
            return  YES;
            
        }
    }
    
    sqlite3_finalize(stmt)
    ;
    [Database closeDB];
    


sqlite3 数据操作 删除

上一篇:【Mysql安装】Mac下安装mysql


下一篇:sqlite3 数据操作 添加