in reply to MySQL Keyword Search
And please use placeholders:
my $sth = $dbh->prepare('SELECT * FROM `productTable` WHERE MATCH(`mfg +`, `productID`, `desc`) AGAINST(?)'); $sth->execute($keywords); # (untested)
If you don't have a fulltext index, you have to split the search word manually, and construct a corresponding SQL statement.
Update: BTW if you decorate all your SQL statements with an 'or die', you could alternatively set the RaiseError option during connect(), that way you'll get a better error message, and you'll type less.
|
|---|