Help for this page

Select Code to Download


  1. or download this
    my $data_source = "DBI:mysql:database=" . $db . ":host=" . $host . ":p
    +ort=" . $port;
    my $dbh = DBI->connect($data_source,$user,$password,{ PrintError => 0}
    +);
    
  2. or download this
    my $data_source = "dbi:mysql:database=$db;host=$host;port=$port";
    #   these colons should be semi-colons   ^          ^
    my $dbh = DBI->connect ($data_source, $user, $password, {
        PrintError => 0,
        });