Feb 26, 2013, 4:03 PM
Simply saying the script doesn't work is a poor problem description. You should explain in what way it's failing and what errors/warnings it produces.
Re: [brosskgm] Perl MySQL help with code.
There are a number of things I'd change, but the initial problem with the database code is in your connection statement. Using single quotes around the vars will prevent interpolation which means that you're passing $user and $pw as literal strings rather than passing the values that those vars hold.
my $dbh = DBI->connect("DBI:mysql:$database:$host" , $user, $pw)
or die "Connection Error: $DBI::errstr\n";
(This post was edited by FishMonger on Feb 26, 2013, 4:05 PM)