It took a while, but this all eventually worked. The problem was almost certainly the single apostrophe, which I hadn't noticed. The code I'm using now reads:
my $sth = $db->prepare("insert into news(url, header, country, country
+2, date, priority, userid, source, formoreinfo, language, regreqd, ke
+ywords, image, actnowcampaigncode, state) values(?,?,?,?,?,?,?,?,?,?,
+?,?,?,?,?)");
foreach $record (@records) {
$n++;
&splitupintofields;
if ($priority > 0) {
$y++;
&convdate;
&convlang;
$sth->execute($url, $header, $country1, $country2, $date, $pri
+ority, $correspondent, $source, $formoreinfo, $language, $regreqd, $k
+eywords, $image, $actnowcampaigncode, $state);
}
}
$db->disconnect();
|