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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [MDTech.us_MAN] Need help writing a script that interacts with a MySQL DB: Edit Log



wickedxter
User

Oct 12, 2012, 6:07 PM


Views: 12558
Re: [MDTech.us_MAN] Need help writing a script that interacts with a MySQL DB

why does your code have these <server ip> does this get replaced by you or by something else?


Code
#dont use ' ','' because if your useing '$server_ip' perl will not interpopulate the the scalar... 
my $conn = DBI->connect('DBI:mysql:bcpadb;host=<server IP>, '<username>', '<password>', { RaiseError => 1 }) || die "Could not connect to the database";

#should be
my $conn = DBI->connect("DBI:mysql:bcpadb;host=<server IP>", "<username>", "<password>", { RaiseError => 1 }) or die "Could not connect to the database";


#change this
my $LName = $FORM{'LName'};
my $FName = $FORM{'FName'};

#to this
my $LName = $FORM{LName};
my $FName = $FORM{FName};



(This post was edited by wickedxter on Oct 12, 2012, 6:29 PM)


Edit Log:
Post edited by wickedxter (User) on Oct 12, 2012, 6:29 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