use DB; our $database = 'script_db'; our $db_user_name = 'script_user'; our $db_password = 'my_secure_pw'; our $dsn = "DBI:mysql:$database:localhost"; # . . . {snip} #FOLLOWING LINE PRODUCES ERROR WITH XAMPP my $dbh = DBI->connect($dsn, $db_user_name, $db_password, { mysql_enable_utf8 => 1 }) or die "Can't connect to the DB: $DBI::errstr\n"; $dbh->{PrintError} = 1; $dbh->{RaiseError} = 1; $quest = $dbh->prepare($statement, { RaiseError => 1}) or die "Cannot prepare statement! $DBI::errstr\n"; $quest->execute();