What would be a good way to search in a field, ignoring spaces in the search terms AND field?
Example:
SELECT *
FROM tablename
WHERE NOSPACES(fieldname) LIKE '%{search term with spaces removed}%'
Real world example:
My client has a website that sells long block engines. However, they often force people to search on their site for “cat 3306 longblock ” (instead of “cat 3306 long block”). We need mechanisms with long blocks that will be displayed when searching for a "long block".
Note: this probably doesn't matter for the purposes of this question, but this site is built using PHP 5.3 and phpActiverecord .
source
share