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?
3
-
How are you attempting to insert the string? Possible duplicate of: stackoverflow.com/questions/12094120/… (which doesn't have a selected answer, but should help you)powerj1984– powerj19842013-12-11 21:56:30 +00:00Commented Dec 11, 2013 at 21:56
-
@powerj1984 sorry, thanks for the linkuser2074701– user20747012013-12-11 22:01:19 +00:00Commented Dec 11, 2013 at 22:01
-
No problem, hope it helpspowerj1984– powerj19842013-12-11 22:11:31 +00:00Commented Dec 11, 2013 at 22:11
Add a comment
|
1 Answer
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];