我正在使用下面的代码片段将 html 字符串插入 sqlite db,我的代码工作正常,但是当我检索相同的 html 字符串并在 web 视图中显示时它不会呈现,一些数据正在被修改,任何人都可以帮助如何插入长 html 字符串到数据库中。
const char *sql = "插入文章 (art_id,sub_cat_id,art_title,art_details) 值(?, ?, ?, ?)";
if(sqlite3_prepare_v2(database, sql, -1, &addStmt, NULL) != SQLITE_OK) NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database)); sqlite3_bind_text(addStmt, 1, [[tuser objectForKey:@"art_id"] UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(addStmt, 2, [[tuser objectForKey:@"sub_cat_id"] UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(addStmt, 3, [[tuser objectForKey:@"art_title"] UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(addStmt, 4, [[tuser objectForKey:@"art_details"] UTF8String], -1, SQLITE_TRANSIENT); if(SQLITE_DONE != sqlite3_step(addStmt)) NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database)); else //SQLite provides a method to get the last primary key inserted by using sqlite3_last_insert_rowid //coffeeID = sqlite3_last_insert_rowid(database); //Reset the add statement. sqlite3_reset(addStmt);