Gnat53 has asked for the wisdom of the Perl Monks concerning the following question:
But I'd like to use placeholders. I've tried:my $sql = qq{SELECT * FROM $table WHERE (MATCH(Author) AGAINST('+herma +n +melville' IN BOOLEAN MODE)) order by Title};
But I get an error message saying two values called when none are needed. (I've tried escaping the single-quotes around the question marks in various ways.) So--I've tried:my $sql = qq{SELECT * FROM $table WHERE (MATCH(Author) AGAINST('? ?' I +N BOOLEAN MODE)) order by Title}; $ding -> execute("+herman", "+melville") or die DBI->errstr;
But, weirdly, that gives me results on "melville" whether "herman" is in the column or not.my $sql = qq{SELECT * FROM $table WHERE (MATCH(Author) AGAINST(?)) ord +er by Title}; $ding -> execute("\'+herman +melville\' IN BOOLEAN MODE") or die D +BI->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI/DBD::mysql placeholders and full text searches
by ikegami (Patriarch) on Sep 29, 2008 at 00:18 UTC | |
by Gnat53 (Novice) on Sep 29, 2008 at 01:50 UTC | |
by ikegami (Patriarch) on Sep 29, 2008 at 02:04 UTC | |
by Tanktalus (Canon) on Sep 29, 2008 at 04:05 UTC | |
by Gnat53 (Novice) on Sep 29, 2008 at 11:46 UTC | |
by ikegami (Patriarch) on Sep 29, 2008 at 12:21 UTC | |
by ikegami (Patriarch) on Sep 29, 2008 at 02:06 UTC |