my $dbh = DBI->connect($dsn, $user, $password) or die "Couldn't connect to database: " . DBI->errstr;
Here you test that the connection has succeeded and bail out if it hasn't. This is good. However, on the subsequent 4 $dbh->do statements you make no such tests. How can you tell if one or more of these have failed?
my $SQL = "select url,document_id FROM $tablename where left(publish_d +ate,6) ='$date'"; my $query = $dbh->prepare($SQL) or die "prepare: ".$dbh->errstr; $query-> execute() or die "execute: ".$dbh->errstr;
No reason at all not to use a placeholder here:
my $SQL = "select url,document_id FROM $tablename where left(publish_d +ate,6) = ?"; my $query = $dbh->prepare($SQL) or die "prepare: ".$dbh->errstr; $query-> execute($date) or die "execute: ".$dbh->errstr;
it runs with no errors, it just doesn't download
Does it print the URL correctly each time through the loop or not?
🦛
In reply to Re^3: Combining Ffile:fetch with MySQL
by hippo
in thread Combining Ffile:fetch with MySQL
by justin423
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |