schnarff has asked for the wisdom of the Perl Monks concerning the following question:
Where @checklists has all the table names to look at and $word has the word I want to spell-check.my $sth = $dbh->prepare('SELECT word FROM ? WHERE word = ?'); foreach my $x (@checklists) { $sth->execute($x, $word); my $ret = $sth->fetchrow_hashref(); ...etc... }
When I tried the same statement with an explicit table name, it worked great.DBD::mysql::st execute failed: You have an error in your SQL syntax ne +ar ''common_dict' WHERE word = 'aa'' at line 1 at ./quiddler.pl line +48. DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at . +/quiddler.pl line 49. Issuing rollback() for database handle being DESTROY'd without explici +t disconnect().
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Querying databases in a loop
by VSarkiss (Monsignor) on May 13, 2002 at 19:15 UTC | |
|
Re: Querying databases in a loop
by perlplexer (Hermit) on May 13, 2002 at 19:23 UTC | |
|
Re: Querying databases in a loop
by perrin (Chancellor) on May 13, 2002 at 19:44 UTC | |
by schnarff (Acolyte) on May 14, 2002 at 00:33 UTC | |
by thor (Priest) on May 14, 2002 at 01:32 UTC | |
by perrin (Chancellor) on May 14, 2002 at 16:21 UTC | |
|
Re: Querying databases in a loop
by kappa (Chaplain) on May 14, 2002 at 06:50 UTC |