Q:

SQLite Insert Not Working in iOS

I am having trouble getting this code to ACTUALLY insert data into my SQLite database via iOS:
            NSString* inssql = [NSString stringWithFormat:@"INSERT OR IGNORE INTO roomData VALUES ('%@', '%i', '%@', '%@', '%@', '%@'); UPDATE roomData SET roomNumber='%@', roomName='%@', roomDesc='%@', roomHash='%@' WHERE roomID = '%@'", [row objectAtIndex:0],property,[row objectAtIndex:1],[row objectAtIndex:2],[row objectAtIndex:3],[row objectAtIndex:4],[row objectAtIndex:1],[row objectAtIndex:2],[row objectAtIndex:3],[row objectAtIndex:4],[row objectAtIndex:0]];
        sql = [inssql UTF8String];

        if (sqlite3_prepare(db, sql, -1, &sqlStatement, NULL) != SQLITE_OK) {
            NSLog(@"MESSAGE: Could not prepare this insert, %s", sqlite3_errmsg(db));
        } else {
            if (sqlite3_step(sqlStatement) == SQLITE_DONE)
            {
                NSLog(@"MESSAGE: Successful insert, %@, %d", [row objectAtIndex:0], sqlite3_step(sqlStatement));
            } else {
                NSLog(@"MESSAGE: Failed insert, %s", sqlite3_errmsg(db));
            }
        }

I'm getting "Successful insert", but there's no data in the database. Any idea what's up? This is my first time using SQLite.
EDIT #1:
I have also tried the following syntax:
            sql = "INSERT INTO roomData VALUES (?)";
        sqlite3_prepare(db, sql, -1, &sqlStatement, NULL);
        sqlite3_bind_int(sqlStatement, 1, 2);
        if(sqlite3_step(sqlStatement)) { NSLog(@"DONE!"); } else { NSLog(@"FAIL: %s",sqlite3_errmsg(db)); }

I get "DONE!", but the database is still empty.
EDIT #2:
I was originally trying to modify the database as it was stored in the application bundle. A mistake, right? So I have installed a script that copies the database to the Library directory and uses that copy instead. But the script still will not insert records into the database. What am I missing here?

A:

I managed to solve this issue. The original issue was definitely that the database file had to be in the Library folder. After solving that, it only wasn't working because my sql statement was not properly inserting the correct number of fields. After correcting my statement, the process worked beautifully. Not sure why it didn't generate an error.

