title: I am getting an error with sqlite3_prepare_v2
body: <p>I am creating an app, and doing update with sqlite. Here is my piece of code given below:</p>
  
  <pre><code>    NSFileManager *fileMgr = [NSFileManager defaultManager];
      NSString *dbPath = [[[NSBundle mainBundle] resourcePath ]stringByAppendingPathComponent:@"appforoffice.sqlite"];
      BOOL success = [fileMgr fileExistsAtPath:dbPath];
      if(!success)
      {
          NSLog(@"Cannot locate database file '%@'.", dbPath);
      }
      if(!(sqlite3_open([dbPath UTF8String], &amp;database) == SQLITE_OK))
      {
          NSLog(@"An error has occured.");
      }
  
      const char *sql = "UPDATE settings SET `value`='Off' WHERE `type`=?";
  if(sqlite3_prepare_v2(database, sql, -1, &amp;updateStmt, NULL) == SQLITE_OK)
      {
          if(sqlite3_bind_text(updateStmt, 1, [updateType UTF8String], -1, SQLITE_TRANSIENT) == SQLITE_OK)
          {
              if(sqlite3_step(updateStmt) == SQLITE_DONE) {
                  NSLog(@"Update Done successfuly");
              }
              else {
                   NSLog(@"Error while updating. '%s'", sqlite3_errmsg(database));
              }
  
              sqlite3_finalize(updateStmt);
              sqlite3_close(database);
          }
          else
          {
              NSLog(@"Error while binding variable. '%s'", sqlite3_errmsg(database));
          }
      }
      else
      {
          NSLog(@"Error while creating update statement. '%s'", sqlite3_errmsg(database));
      }
  </code></pre>
  
  <p>But guys, <strong>I am not getting any error</strong>. But the problem is that, <strong>the database table is not being effected by the query</strong>. I am sure the query is perfectly alright.</p>
  
  <p>I am confused about the problem, can't find any way to get out of this.</p>