|
|
@ -55,6 +55,7 @@ sub db_connect { |
|
|
|
my $dbh = DBI->connect("DBI:mysql:database=$opts{dbname};host=$opts{dbhost}", |
|
|
|
my $dbh = DBI->connect("DBI:mysql:database=$opts{dbname};host=$opts{dbhost}", |
|
|
|
$opts{dbuser}, $opts{dbpass}, {RaiseError => 1}); |
|
|
|
$opts{dbuser}, $opts{dbpass}, {RaiseError => 1}); |
|
|
|
die "Couldn't connect to database\n" unless ($dbh); |
|
|
|
die "Couldn't connect to database\n" unless ($dbh); |
|
|
|
|
|
|
|
$dbh->do("SET NAMES 'UTF8';") or die "Couldn't set names to UTF-8: ".DBI::errstr; |
|
|
|
return $dbh; |
|
|
|
return $dbh; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|