topr8 - 12:44 pm on Feb 13, 2013 (gmt 0)
i never thought i'd say to jakar_k are you sure!
but i'd have thought it would be more like:
select * from tablename where name LIKE '%London Hotels%' or title LIKE '%London Hotels%' or content LIKE '%London Hotels%'
that is assuming that the entire field is not exactly equal to the search string
it would be even more complex if you were searching for the words seperately rather than as a phrase.
i'd suggest you create a FULL TEXT INDEX on the columns you want to search
and then you would query it something like:
select * from tablename where MATCh(name,title,content) against('London','Hotels')
this way you'd be searching for the two words to appear but not neccesairily as a phrase or in the same columns, i'm a bit rusty with text search so my syntax my be slightly out.
or search for the phrase thus:
select * from tablename where MATCh(name,title,content) against('London Hotels')
by default the full text index only indexes words of 4 letters and above i think, if i use it i tend to reset it to words of 3 letters and above.