title: getting Data From SQLite Database;
body: <p>Unable to get Data..</p>
  
  <pre><code>- (void)getAmountFromDB
  {
      expensesArray = [[NSMutableArray alloc]init];
  
      NSString *destinationPath = [self getDestinationPath];
  
      const char *dbpath = [destinationPath UTF8String];
      sqlite3_stmt    *statement;
  
      if (sqlite3_open(dbpath, &amp;database) == SQLITE_OK)
      {
          NSLog(@"month String is = %@",monthString);
          NSString *querySQL = [NSString stringWithFormat: @"SELECT breakFastAmt,lunchAmt,dinnerAmt,dailyTravelAmt,outStationTravelAmt FROM TABLE_For_Expenses WHERE month=\"%@\"",monthString];
  
  
          const char *query_stmt = [querySQL UTF8String];
  
          if (sqlite3_prepare_v2(database, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)
          {
  
              while (sqlite3_step(statement) == SQLITE_ROW)
              {
                  NSLog(@"hi");
                  }         
  </code></pre>
  
  <p>Flow Not Entering in following condition.</p>
  
  <pre><code>if (sqlite3_prepare_v2(database, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)
  </code></pre>
  
  <p>BUT its Working For Following Code;</p>
  
  <pre><code>- (void) getDataFromDB
  {
      expensesArray = [[NSMutableArray alloc]init];
  
      NSString *destinationPath = [self getDestinationPath];
  
      const char *dbpath = [destinationPath UTF8String];
      sqlite3_stmt    *statement;
  
      if (sqlite3_open(dbpath, &amp;database) == SQLITE_OK)
      {
          NSString *querySQL = [NSString stringWithFormat: @"SELECT * FROM TABLE_For_Expenses"];
  
  
          const char *query_stmt = [querySQL UTF8String];
  
          if (sqlite3_prepare_v2(database, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)
          {
  
              while (sqlite3_step(statement) == SQLITE_ROW)
              {
                             NSLog (@"hi");
                          }
                 }
       }
  }
  </code></pre>