title: how to fetch data from sqlite database table in ios?
body: <p>i want to fetch data from my database table when i enter the name of the star in textfield the it give me all the quotes of that star for random names of star.     </p>
  
  <pre><code>-(NSMutableArray *)searchAllQuotesOfStar
  {
      NSString *starName = [[NSString alloc] init];
  
      //    NSString *name = [NSString stringWithFormat:@"starName"];
  
      NSMutableArray *starQuoteArray = [[NSMutableArray alloc] init];
  
      NSString *sqlStr = [NSString stringWithFormat:@"SELECT quote FROM quotes where star like '%%starName%%'"];
  
      //SELECT count(quote) from quotes where star like '%ac%'
  
      sqlite3_stmt *ReturnStatement = (sqlite3_stmt *) [self getStatement:sqlStr];
  
      while (sqlite3_step(ReturnStatement)==SQLITE_ROW)
      {
          @try
          {
              searchStarQuoteDC *searchQoute = [[searchStarQuoteDC alloc] init];
  
              NSString *quote = [NSString stringWithUTF8String:(char*)sqlite3_column_text(ReturnStatement, 0)];
  
              searchQoute.quote = quote;
  
              //                NSLog(@"%@", quote);
  
              [starQuoteArray addObject:searchQoute];
          }
          @catch (NSException *ept) {
  
              NSLog(@"Exception in %s, Reason: %@", __PRETTY_FUNCTION__, [ept reason]);
          }
      }
  
      return  starQuoteArray;
  }
  </code></pre>