PrimaveraTard
MIS
I'm havin a helluva day. I'm trying to access a txt file that has records from my db. The user selects the date (which is also the folder name) and the table (which is also the file name) then I want it to reload those records back into an empty table. Right now, It says it can't even open the file. What am I doing wrong?
my $foldername = param('folder_name');
my $tablename = param('table_name');
open(DAT,"<../../Backup Data Files/$foldername/$tablename.txt" || die("Cannot Open File"
my @line=<DAT>;
foreach $line (@line)
{
my $sql = qq{INSERT INTO $tablename VALUES ($line) };
my $sth = $dbh->prepare( $sql );
$sth->execute();
$sql = qq{ COMMIT };
$sth = $dbh->prepare( $sql );
$sth->execute();
};
close(DAT);
my $foldername = param('folder_name');
my $tablename = param('table_name');
open(DAT,"<../../Backup Data Files/$foldername/$tablename.txt" || die("Cannot Open File"
my @line=<DAT>;
foreach $line (@line)
{
my $sql = qq{INSERT INTO $tablename VALUES ($line) };
my $sth = $dbh->prepare( $sql );
$sth->execute();
$sql = qq{ COMMIT };
$sth = $dbh->prepare( $sql );
$sth->execute();
};
close(DAT);