Help for this page

Select Code to Download


  1. or download this
        my $dbh = DBI->connect(
            'DBI:mysql:db_main',
    ...
                on_connect_do => [ "SET NAMES 'utf8'", "SET CHARACTER SET 
    +'utf8'" ]
            }
        )
    
  2. or download this
          
    my $dbh = DBI->connect('DBI:ODBC:Driver={SQL Server};Server=SQL2008;Da
    +tabase=db_main;UID=user;PWD=pass')
        or die "$DBI::errstr\n";
    
  3. or download this
    my $sql = "insert test values (N'中文')";