in reply to PERL and MySQL
sprintf is trying to interpret the % characters as format string tokens. If the first character of $search is a valid field specifier, you get weird results. You want literal % characters in the finished expression, so use '%%' instead:WHERE `Keys`.`Keywords` LIKE '%$search%'
...and I bet things might go your way.WHERE `Keys`.`Keywords` LIKE '%%$search%%'
Proof of concept:
bash$ perl -e '$a=22; printf "%$a%\n";' % bash$ perl -e '$a=22; printf "%%$a%%\n";' %22%
|
|---|