简体   繁体   中英

how to store html string in sqlite using objective c

I want to store an html description tag into a sqlite database. Basically I convert the tag to a string but when I try to insert it into the database i get a near"0": syntax error. does anyone know of a way I can store the string?

I would recommend to use FMDatabase ( https://github.com/ccgus/fmdb ) as a SQLite wrapper for iOS/Cocoa. FMDatabase is a very popular framework, used in endless projects and well maintained. I heavily use it for more than 4 years.

Code sample :

FMDatabase *db; // Your DB object
[db executeUpdate:@"INSERT INTO table (key,value) VALUES (?, ?)", yourKey, longHtmlString, nil];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM