Hi
Can't be to helpful without knowing what sort of error you are seeing. Is it failing when attempting to fetch the row or before that? Is the error not in database retrieval at all - e.g. does the file exist and have the data expected?
You could use indenting to make the code a little easier to read and you could change that while loop as below or use $_ as pc88mxer has already suggested.
while(my $kk = <FILE>) { chomp($kk); print "$kk\n"; $sth ->execute($kk) or die "Couldn't execute statement: " . $sth->er +rstr; my ($dup) = $sth->fetchrow_array(); print "$dup"; if($dup eq $kk) { print"persent"; } }
In reply to Re: error in sql query while using DBI
by LesleyB
in thread error in sql query while using DBI
by mahicool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |