title: library routine called out of sequence
body: <p>I am trying to write into a DB in sqlite on the iphone , i want to enter 3 values into the DB . Given Below is my code but i am getting the following sqlite error message:</p>
  
  <pre><code>-(void) writeintoDatabase:(id)value1:(id)value2:(id)value3 {
  sqlite3 *database;
  
  
      const char *sql = "insert into UserData(firstName,lastName,userName) Values(?, ?, ?)";
      sqlite3_stmt *insert_statement;
      sqlite3_prepare_v2(database, sql, -1, &amp;insert_statement, NULL);
  
      sqlite3_bind_text(insert_statement, 1, [value1 UTF8String], -1, SQLITE_TRANSIENT);
      sqlite3_bind_text(insert_statement, 2, [value1 UTF8String], -1, SQLITE_TRANSIENT);
      sqlite3_bind_text(insert_statement, 3, [value1 UTF8String], -1, SQLITE_TRANSIENT);
  
      NSInteger keyID;
  printf( "could not prepare statemnt: %s\n", sqlite3_errmsg(database) ); 
  
          keyID = sqlite3_last_insert_rowid(database);
  
  
      sqlite3_reset(insert_statement);
  
  }
  </code></pre>