title: Data not inserting into sqlite database
body: <p>Hi in my application I have data which want insert into my <code>sqlite</code> database .So  I have already created the database successfully, But the problem its not insert data into database.</p>
  
  <p>My database creation code.</p>
  
  <pre><code> - (void)createDatabase
    {
  
       NSArray *directories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
       NSString *doctumentsDirectory = [directories lastObject];
       self.databasePath = [[NSString alloc] initWithString:[doctumentsDirectory stringByAppendingPathComponent:@"/bp.sqlite"]];
  
       NSFileManager *fileManager = [NSFileManager defaultManager];
  
     // create DB if it does not already exists
     if (![fileManager fileExistsAtPath:self.databasePath]) {
  
         const char *dbPath = [self.databasePath UTF8String];
  
      if (sqlite3_open(dbPath, &amp;_myDataBase) == SQLITE_OK) {
  
          char *errorMsg;
          const char *sql_statement = "CREATE TABLE IF NOT EXISTS br (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT, COST TEXT,QUTY TEXT)";
  
          if (sqlite3_exec(_myDataBase, sql_statement, NULL, NULL, &amp;errorMsg) != SQLITE_OK)    {
  
              [self errorCreatingTable:[NSString stringWithFormat:@"failed creating table. ERROR:%s", errorMsg]];
           }
  
            sqlite3_close(_myDataBase);
  
        } else {
  
           [self errorCreatingTable:@"failed openning / creating table"];
        }
     }
   }
  </code></pre>
  
  <p>My insert code i have UIButton action method where i give my insert code.</p>
  
  <pre><code>  -(void)aMethod2:(UIButton*)sender
   {
  
      NSString *inr=[intarr objectAtIndex:sender.tag];
      NSLog(@"%@",inr);
      NSString *item=[self.menuarray objectAtIndex:sender.tag];
      NSLog(@"%@",item);
      NSString *cost=[self.menuarray1 objectAtIndex:sender.tag];
      NSLog(@"%@",cost);
      NSString *sql = [NSString stringWithFormat:@"INSERT INTO br ('NAME','COST','QUTY') VALUES ('%@','%@','%@')",item,cost,inr];
      NSLog(@"%@",sql);
   }
  </code></pre>
  
  <p>I have used the above code where get the data and inserting into my database but values all passing correctly problem is its not inserting into my database please tell me how to resolve this issue I have been stuck here for long time help me out.</p>
  
  <p>Thanks. </p>