sixcolors has asked for the wisdom of the Perl Monks concerning the following question:
I am getting this error with this code:
[Fri May 18 19:40:00 2001] asdma.pl: DBD::CSV::Statement=HASH(0x8286b18) is not a valid SQL::Statement object at /usr/lib/perl5/DBD/File.pm line 171.Also I know the '%$query%' in not a proper statment... any ideas?
my $query; foreach $query (@astype) { print $query; my $sql = "select title from $TABLE2 where astype like '%$query'"; my $sth = $dbh->prepare($sql) or die "Cannot Prepare: " . $dbh->errstr(); $sth->execute() or die "Cannot execute: " . $sth->errstr(); while (@row = $sth->fetchrow_array()) { $adlocation = ( join (",", @row)); } print $adlocation;
Edited 2001-05-19 by mirod: added <code> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI and like statment
by mr.nick (Chaplain) on May 19, 2001 at 09:06 UTC | |
|
Re: DBI and like statment
by yakko (Friar) on May 19, 2001 at 07:33 UTC | |
|
Re: DBI and like statment
by chipmunk (Parson) on May 19, 2001 at 19:25 UTC | |
by sixcolors (Initiate) on May 31, 2001 at 08:49 UTC | |
|
Re: DBI and like statment
by AidanLee (Chaplain) on May 19, 2001 at 08:13 UTC |