title: No rows being returned in sqlite select statement
body: <p>I am having trouble selecting data from my database. Maybe its just to early here, but it looks as if I never get anything returned but I put break points in to stop inside the while statement and it never reaches that part of the code. Did I mess something up in this? I did omit the create statement because it is rather long and I dont think that it is relevant because it does contain <code>IF NOT EXISTS</code>. I also verified that I do have all my data in the database.</p>
  
  <pre><code>sqlite3 *database;
  if(sqlite3_open([[self dataFilePath] UTF8String], &amp;database)
     != SQLITE_OK) {
      sqlite3_close(database);
      NSAssert(0,@"Failed to open database");
  }
  
  NSString *createSQL = @"--CREATE STATEMENT HERE --";
  
  char *errorMsg;
  
  if(sqlite3_exec (database, [createSQL UTF8String], NULL, NULL, &amp;errorMsg) != SQLITE_OK) {
      sqlite3_close(database);
      NSAssert(0,@"Error creating table: %s", errorMsg);
  }
  
  NSString *query = @"SELECT name, number FROM DATA";
  sqlite3_stmt *statement;
  if (sqlite3_prepare_v2(database, [query UTF8String], -1, &amp;statement, nil) == SQLITE_OK) {
      while (sqlite3_step(statement) == SQLITE_ROW) {
          int myNumber = sqlite3_column_int(statement, 1);
          char *name = (char *)sqlite3_column_text(statement, 0);
          NSString *message = [NSString stringWithFormat:@"Number: %d, Name: %@", myNumber,name];
          //DO MORE STUFF HERE.
      }
      sqlite3_finalize(statement);
  }
  sqlite3_close(database);
  </code></pre>
  
  <p>dateFilePath Method:</p>
  
  <pre><code>-(NSString*)dataFilePath {
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      return [documentsDirectory stringByAppendingPathComponent:@"Spaces.sqlite"];
  }
  </code></pre>