I cannot believe iam THAT careless....my apologies and think you for pointing this out.
my $insert = $db->prepare( 'INSERT INTO articles (title, body) VALUES
+(?, ?)' );
my @files = glob "$ENV{'DOCUMENT_ROOT'}/data/text/*.txt";
foreach (@files) {
open FILE, "$_" or die "error opening $_: $!";
while (<FILE>) {
chomp;
$insert->execute(split /\t/, $_, 2) or print $db->errstr;
}
close FILE;
}
gives me DBD::mysql::st execute failed: called with 1 bind variables when 2 are needed....
But iam passing it 2 vars why it says iam passing it only 1? |