Question: I'm using FMDB to interface with an SQLite database. I have it inserting rows fine, but when I try and UPDATE one of them, the UPDATE does not occur, but no error is reported.

Here's what I'm doing:

```
userHistoryDB.logsErrors = YES;
userHistoryDB.traceExecution = YES;
NSString *query = [NSString stringWithFormat:
         @"INSERT OR IGNORE INTO phrase_history (code, %@) VALUES (\"%@\", 0); "
         @"UPDATE OR FAIL phrase_history SET %@ = %@ + 1 WHERE code = \"%@\";",
         countTypeColumn,
         phraseCode,
         countTypeColumn,
         countTypeColumn,
         phraseCode];
BOOL rc = [userHistoryDB executeUpdate:query];

```

rc is YES, to indicate nothing is wrong. Here is an example call:

```
<FMDatabase: 0x5303af0> executeUpdate: INSERT OR IGNORE INTO phrase_history (code, presented) VALUES ("grapefruit", 0); UPDATE OR FAIL phrase_history SET presented = presented + 1 WHERE code = "grapefruit";

```

As far as FMDB is concerned, this has executed fine. However, the record does not increment. There is nothing wrong whatsoever with the SQL - if I paste it into the sqlite3 command line tool, it runs perfectly.

Any ideas as to why it's not running? Things I have tried to no avail:

* Enclosing the line in a transaction
* Running using executeQuery
* Running just the update (with the entry already manually inserted).
* Slamming head against desk.

Answer: 
You have two sqlite statements there, and FMDB won't automatically convert your single compound line into two separate statements. You need to run them separately, which is what the sqlite3 command line tool is doing.
where your database is stored? in the bundle? or in other location?

if you have your database in your project folder, when you compile, Xcode will create the app bundle in build/Debug or build/Release, this is where your database will be located, not the one in your project folder. Check if the database in build/Debug(Release) is updated? The database in your project folder will not be updated, since you may be request the location of your app bundle.

when you check the database by the command line, did you check the database in your project bundle or in the build/Debug(Release) folders?