title: Insert Query not working (FMDB)
body: <p>Here is the code which I'm using to insert a record into a sqlite table </p>
  
  <pre><code>FMDatabase *dataBase = [self openDatabase];
      [dataBase open];
      if ([dataBase open] != YES) {
          NSLog(@"DB Error %d: %@", [dataBase lastErrorCode], [dataBase lastErrorMessage]);
      //VERY IMPORTANT
      }
  
      BOOL success= [dataBase executeUpdate:@"Insert into CrewUnits (pkCrewUnits,fkUnits,fkAgencyVehicles,fkLookupCodes_PrimaryRole, fkLookupCodes_LevelOfCare, PrimaryUnit) values (?, ?, ?, ?, ?, ?);", pkCrewUnits, fkUnits, fkAgencyVehicle, fkLookupCodes_PrimaryRole, fkLookupCodes_LevelOfCare, [NSNumber numberWithInt:1]];
      NSLog(success ?@"YES" :@"NO");
       NSLog(@"Error %d: %@", [dataBase lastErrorCode], [dataBase lastErrorMessage]);
     FMResultSet*resultSet= [dataBase executeQuery:@"select * from CrewUnits"];
      NSLog(@"ResultSet : %@", [resultSet resultDictionary]);
  
      [dataBase close];
  </code></pre>
  
  <p>Database Path</p>
  
  <pre><code>- (FMDatabase *)openDatabase
  {
  
      NSLog(@"Open Database");
      NSString *documents_dir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
      NSString *db_path = [documents_dir stringByAppendingPathComponent:[NSString stringWithFormat:@"HPSix_05BD.db"]];    // DatabasePath
      FMDatabase *db = [FMDatabase databaseWithPath:db_path];
      if (![db open])
          NSLog(@"Failed to open database!!!!!");
      return db;
  }
  </code></pre>
  
  <p>I'm using the same logic to fetch data from table that works fine for me. But I can't insert a record. I don't know what I'm doing wrong here.</p>