Code: Select all
WHERE `column` LIKE '%{$needle}%'I need it in reverse - ie the column as needle and the string as haystack. I have tried
but get problems.column IN (string)
for example I have a list of cities in database and someone types city and country - someone types
which I need to match to a column with just new york. I have tried breaking it up which works with simpler examplesnew york usa
but that gets more complicated when you create'london', 'england'
then I can't match new york.'new', 'york', 'usa'
If anyone can give me any ideas to match 'new york usa' or 'long city name the federal republic of wherever' etc etc that would be great. like strpos in php.