title: sqlite, select query doesn't work
body: <pre><code>- (UserInfo*)getCurrentUserInfo:(NSString*)userName
  {
      UserInfo *userInfo = [[UserInfo alloc]init];
  
      sqlite3 *database;
      sqlite3_stmt *selectstmt;
      NSLog(@"userName:%@",userName);
      if(sqlite3_open([databasePath UTF8String], &amp;database) == SQLITE_OK) {
          NSString *sqlString = [NSString stringWithFormat:@"SELECT USER_LEVEL FROM USER_INFO WHERE USER_NAME = '%@'" , userName];
          NSLog(@"getCurrentUserInfo:%@",sqlString);
          const char *SqlCommand = [sqlString UTF8String];
          if (sqlite3_prepare_v2(database, SqlCommand, -1, &amp;selectstmt, NULL) == SQLITE_OK) {
              NSLog(@"success!");
              while (sqlite3_step(selectstmt) == SQLITE_ROW) {
                  NSString *userInfoStr = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 0)];
                  NSLog(@"select result:%@",userInfoStr);
              }
          }
          sqlite3_finalize(selectstmt);
      }
      sqlite3_close (database);
      return userInfo;
  }
  </code></pre>
  
  <p>the following is my log output:</p>
  
  <pre><code>2012-03-06 17:50:11.556 MagicWords[508:f803] userName:Tan
  2012-03-06 17:50:11.557 MagicWords[508:f803] getCurrentUserInfo:SELECT USER_LEVEL FROM USER_INFO WHERE USER_NAME = 'Tan'
  </code></pre>
  
  <p>It doesn't print "success",so sqlite3_prepare_v2 don't return yes.but my database is ok:</p>
  
  <p>I can't find the problem?</p>