title: Query using FMDB not returning result
body: <p>I am trying to get the next highest PK in an SQLite database that was not originally set up with auto increment and already has hundreds of records.  So I made the below method which seems like it should work, but I am not able to get any results from this.  I have several other methods that get data from the database that work and can't figure out what I'm doing wrong and I'm going cross-eyed so thought I'd ask for some help. </p>
  
  <pre><code>- (NSInteger)getNextSubjectId {
  
      DrillDownAppAppDelegate *appDelegate = (DrillDownAppAppDelegate *)[[UIApplication sharedApplication] delegate];
  
      FMDatabase *database = [FMDatabase databaseWithPath:appDelegate.getDBPath];    
      [database open];
  
      FMResultSet *rst = [database executeQuery:@"select max(subject_id) + 1 AS SUBJECT_ID from SUBJECT"];
  
      NSLog(@"PRINT FIRST SUBJECT_ID = %@", [rst stringForColumnIndex:0]);
  
      NSString *nextSubId = [rst stringForColumnIndex:0];
      [database close];
  
      NSLog(@"NEW SUBJECT_ID = %@", nextSubId);
  
  
      NSInteger myInt = [nextSubId intValue];
  
      return myInt;
  
      //    [maxSubjectId release];
  
  }
  </code></pre>
  
  <p>The log shows: </p>
  
  <p>2012-01-25 22:56:29.398 Quotes[6992:f803] PRINT FIRST SUBJECT_ID = (null)
  (gdb) </p>
  
  <p>The header looks like this: </p>
  
  <pre><code>//  Subject.h
  //  DrillDownApp
  
  #import &lt;UIKit/UIKit.h&gt;
  
  @interface Subject : NSObject {
      NSInteger subject_id;
      NSString *category_title;
      NSString *title;
      BOOL isDirty;
  
  }
  
  - (id) initWithPrimaryKey:(NSInteger)pk;
  - (void) addSubject;
  - (NSInteger)getNextSubjectId;
  
  @property (nonatomic, readwrite) BOOL isDirty;
  @property (nonatomic, readonly) NSInteger subject_id;
  @property (nonatomic, retain) NSString * title;
  @property (nonatomic, retain) NSString * category_title;
  
  @end
  </code></pre>