Help for this page

Select Code to Download


  1. or download this
     my $dbh = DBI->connect( 'DBI:mysql:mysql', 'username', 'password' )
               || die $DBI::errstr;
     $dbh->do( 'use ' . DBNAME );
    
  2. or download this
     use constant DSN => 'DBI:mysql:database=devel';
     ...
     my $dbh = DBI->connect( DSN, 'username', 'password' )
               || die $DBI::errstr;