in reply to MySQL Select problem

The problem doesn't appear to be in your select statement at all (once you fix the quote issue). The problem appears to be your logic concerning the name parameter.

Quick guess at a solution (not tested at all):

my @names = split(/\s/, param("name")); my $name = join("%", @names) . " OR " . join("%", reverse @names); my $sql = "select * from table where name like $name";
This should at least get you thinking in a different direction. :)