I have an iOS app using FMDB library.
There is a 7 field SQLite DB (1 autoincrement, 6 regular text fields).
I am trying to execute
[db executeUpdate:@"INSERT INTO messages VALUES (:field1,:field2,:field3,:field4,:field5,:field6)" withParameterDictionary:message];
However because there are only 6 fields I get an error. I cannot insert the autoincrement value, since I do not know what it is (I guess I could put a separate query for that...). And I am trying to avoid injection-susceptible syntax
NSString* sql = [NSString stringWithFormat:@"insert into messages (%@) values (%@)", [newCols componentsJoinedByString:@", "], [newVals componentsJoinedByString:@", "]];
Thank you for advice!