title: Inserting into sqlite3 database
body: <p>In my app, I need to save the user local as well as online, but the problem comes when I want to insert the user into its local database (sqlite3).</p>
  
  <p>The user gets to select a char, also a username, this is put through a method to my dbhandler object, like shown.</p>
  
  <pre><code> -(BOOL) registerUser : (NSString *) username : (int) character {
  
  sqlite3 *db;
  
  if(sqlite3_open([dbpath UTF8String], &amp;db) == SQLITE_OK)
  {  
      NSString *formatetStmt = [NSString stringWithFormat:@"INSERT INTO user VALUES (null, '%@', %d, 0, 1, 5, 1, 1, 1, 1, 1 ,1)", username, character];
      sqlite3_stmt *comstmt;
  
      if(sqlite3_prepare_v2(db, [formatetStmt UTF8String], -1, &amp;comstmt, NULL) == SQLITE_OK)
      {                       
          sqlite3_finalize(comstmt);
  
          if(sqlite3_step(comstmt) == SQLITE_DONE) {
              NSLog(@"SUCCESS");
              sqlite3_finalize(comstmt);
              return YES;
          }
          else { 
              NSLog(@"NO SUCCES");
              return NO;
          }
          sqlite3_reset(comstmt);    
      }
  }
  
  NSAssert1(0, @"addMyObjectIntoDatabase: failed to prepare statement with err '%s'", sqlite3_errmsg(db));
  
  NSLog(@"FAIL");
  sqlite3_close(db);
  return NO;
  
  }
  
  }
  </code></pre>
  
  <p>When the code I executed, it says NO SUCCESS, however I do not get a error, and nothing is added to the db.</p>
  
  <p>Ami doing anything wrong here?</p>