Bungholio
09-08-2003, 09:24 PM
Hey ppl, thnx for looking!
I just wanted to throw in a little DB storage of Name/Email into a already functioning PERL script, that i did not write. This is my first venture into Perl, so sorry if its something st00pid. I tried looking at the dbi.perl.com stuff but the links are either dead or go back to perl.com which tell you to go to dbi.perl.com ... ugh ... anyways, i just added this in the script;
note: the top bit above 'My New Stuff' comment is the top of the file.
#!/usr/bin/perl
# Get the data
%input = e"t_request;
#---->My New Stuff<---
use DBI;
my $serverName = "externalsite.com";
my $serverUser = "userName";
my $serverPass = "passWord";
my $serverDb = "dbName";
my $serverTabl = "tableName";
$dbh = DBI->connect("DBI:mysql:database=$server Db;host=$serverName;",$serverUser,$serverPass);
$Name = $input{'name'};
$Email = $input{'from_email'};
$myDate = '1900-00-00 24:00:00';
$success = $dbh->do("INSERT INTO $serverTabl(Name,Email,Date) VALUES(?,?,?)", undef, $Name, $Email, $myDate);
$dbh->disconnect;
#------------------------------------------
Ive double checked the capitization and spelling, and the date is bogus, the name and email come from the previous page...
anwyays, i just get a 500 internal server error, and the host will not help with MY script :( :( :( ... so if you can help at all, i would really appreciate it,
thanks again,
Al
I just wanted to throw in a little DB storage of Name/Email into a already functioning PERL script, that i did not write. This is my first venture into Perl, so sorry if its something st00pid. I tried looking at the dbi.perl.com stuff but the links are either dead or go back to perl.com which tell you to go to dbi.perl.com ... ugh ... anyways, i just added this in the script;
note: the top bit above 'My New Stuff' comment is the top of the file.
#!/usr/bin/perl
# Get the data
%input = e"t_request;
#---->My New Stuff<---
use DBI;
my $serverName = "externalsite.com";
my $serverUser = "userName";
my $serverPass = "passWord";
my $serverDb = "dbName";
my $serverTabl = "tableName";
$dbh = DBI->connect("DBI:mysql:database=$server Db;host=$serverName;",$serverUser,$serverPass);
$Name = $input{'name'};
$Email = $input{'from_email'};
$myDate = '1900-00-00 24:00:00';
$success = $dbh->do("INSERT INTO $serverTabl(Name,Email,Date) VALUES(?,?,?)", undef, $Name, $Email, $myDate);
$dbh->disconnect;
#------------------------------------------
Ive double checked the capitization and spelling, and the date is bogus, the name and email come from the previous page...
anwyays, i just get a 500 internal server error, and the host will not help with MY script :( :( :( ... so if you can help at all, i would really appreciate it,
thanks again,
Al