N
Nikos
With this way since is more straighforward and less lines of code: Now
the code is like this:
#=======================LOADING THE .TXT TO THE DATABASE==============
+==========
my $replace = $dbh->prepare( "REPLACE INTO games (gamename, gamedesc,
+gamecounter) VALUES (?, ?, ?)" );
open (FILE, "<../data/games/descriptions.txt") or die $!;
while (<FILE>) {
chomp;
if (length) {
$replace->execute( split(/\t/, $_, 2), 0 ) or print $dbh->errs
+tr;
}
}
close (FILE);
But the records never get updated and if i delete a row on the txt file
but the insertion of a new row or an edit of an existing one work ok
the code is like this:
#=======================LOADING THE .TXT TO THE DATABASE==============
+==========
my $replace = $dbh->prepare( "REPLACE INTO games (gamename, gamedesc,
+gamecounter) VALUES (?, ?, ?)" );
open (FILE, "<../data/games/descriptions.txt") or die $!;
while (<FILE>) {
chomp;
if (length) {
$replace->execute( split(/\t/, $_, 2), 0 ) or print $dbh->errs
+tr;
}
}
close (FILE);
But the records never get updated and if i delete a row on the txt file
but the insertion of a new row or an edit of an existing one work ok