Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
But it dies with the error "Called with 3 bind variables when 0 are needed". How come? What should I do instead?foreach my $word (@words) { my $sth = $dbh->prepare( "SELECT * FROM my_table WHERE description LIKE '%?%' OR shortdescription LIKE '%?%' OR name LIKE '%?%'" ) || die "Error: " . $dbh->errstr; $sth->execute($word,$word,$word) || die "Error: " . $dbh->errstr; # do some stuff }
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI - I can't use bind variables with "like"?
by jZed (Prior) on Jun 30, 2006 at 00:58 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by lestrrat (Deacon) on Jun 30, 2006 at 00:18 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by grinder (Bishop) on Jun 30, 2006 at 20:53 UTC | |
by runrig (Abbot) on Jun 30, 2006 at 21:38 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by jdtoronto (Prior) on Jun 30, 2006 at 09:59 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by eric256 (Parson) on Jun 30, 2006 at 14:47 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by Mandrake (Chaplain) on Jun 30, 2006 at 05:12 UTC | |
by clinton (Priest) on Jun 30, 2006 at 08:43 UTC | |
|
Re: DBI - I can't use bind variables with "like"?
by devinb (Novice) on Jul 03, 2006 at 15:27 UTC |