while ( ) { my $line = $_; chomp ($line); my @word = split / /, $line; $count = 0; while ( $word[ $count ] ) { $word[ $count ] =~ tr/^[\.\/\\=a-zA-Z]//; $count++; } foreach my $string ( @word ) { next if $uword{ $string } == 1; $uword{ $string } = 1; } } $count = 0; while ( my ($key, $value) = each(%uword) ) { my ( $owner, $om, $manager ); my $select = qq/SELECT r.owner, r.om, r.manager /; my $from = qq/FROM r, n /; my $where = qq/WHERE MATCH(r.owner, r.om, r.manager) AGAINST('+$key' IN BOOLEAN MODE) /; my $likedate = qq/AND n.time LIKE '$date%' /; my $join = qq/AND r.key = n.key/; my $query = $select . $from . $where . $likedate . $join; print "SQL: $query\n"; my $sth = $dbh->prepare( $query ); $sth->execute; #### SQL: SELECT r.owner, r.om, r.manager FROM r, n WHERE MATCH(r.owner, r.om, r.manager) AGAINST('+Miller's' IN BOOLEAN MODE) AND n.time LIKE '2009%' AND r.key = n.key DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's' IN BOOLEAN MODE) AND n.time LIKE '2009%' AND r.key = n.k' at line 1 at ./ssel.pl line 55, line 57. DBD::mysql::st bind_columns failed: Statement has no result columns to bind (perhaps you need to successfully call execute first) at ./ssel.pl line 57, line 57. DBD::mysql::st fetch failed: fetch() without execute() at ./ssel.pl line 59, line 57.