in reply to Re^2: Combining Ffile:fetch with MySQL
in thread Combining Ffile:fetch with MySQL
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?
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Combining Ffile:fetch with MySQL
by afoken (Chancellor) on Jul 24, 2022 at 10:13 UTC | |
|
Re^4: Combining Ffile:fetch with MySQL
by justin423 (Scribe) on Jul 24, 2022 at 15:28 UTC | |
by justin423 (Scribe) on Jul 24, 2022 at 17:48 UTC | |
by hippo (Archbishop) on Jul 24, 2022 at 22:34 UTC | |
by justin423 (Scribe) on Jul 24, 2022 at 23:13 UTC | |
by hippo (Archbishop) on Jul 25, 2022 at 14:38 UTC | |
|