CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI: Re: [brosskgm] Perl MySQL help with code.: Edit Log

Veteran / Moderator

Feb 26, 2013, 4:03 PM

Views: 58971
Re: [brosskgm] Perl MySQL help with code.

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.

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)

Edit Log:
Post edited by FishMonger (Veteran) on Feb 26, 2013, 4:05 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives