title: how to insert data into data base in iphone
body: <p>i am inserting data into data base using following code but data is not inserted in the database 
  i am using following code</p>
  
  <p>I am inserting data into iphone application but it does not insert </p>
  
  <p>i have table survey_question_master(question_id,question_text,question_type)</p>
  
  <pre><code>- (void) addCoffee {
      if(addStmt == nil) {
          const char *sql = "insert into survey_question_master(question_text,question_type) Values( ? ,?)";
  
          if(sqlite3_prepare_v2(database, sql, -1, &amp;addStmt, NULL) != SQLITE_OK)
              NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
      }
  
      sqlite3_bind_text(addStmt, 1, [question_text UTF8String], -1, SQLITE_TRANSIENT);
      sqlite3_bind_text(addStmt, 2, [question_type UTF8String], -1, SQLITE_TRANSIENT);
  
      if(SQLITE_DONE != sqlite3_step(addStmt))
          NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
      else
          question_ID = sqlite3_last_insert_rowid(database);
  
      //Reset the add statement.
      sqlite3_reset(addStmt);
  }
  
  
  
     - (void) addCoffee:(DataController *)coffeeObj {
  
      //Add it to the database.
      [coffeeObj addCoffee];
     //Add it to the coffee array.
      [coffeeArray addObject:coffeeObj];
       NSLog(@"Succeessfully Added");
      }
  </code></pre>