I have the following query for my cms, I use it to find posts based on provided search query by user:
"SELECT post_content FROM c_posts WHERE post_content LIKE '%$s%' OR post_title LIKE '%$s%' OR post_description LIKE '%$s%' OR link_title LIKE '%$s%' OR tags LIKE '%$s%' AND post_status <> 'Initialized'";
It works fine when query $s
is a word like 'something' but it doesn't return anything if $s
includes space anywhere like 'something else' or ' something'. I need to search for exact word. so I can't trim the space. how do deal with this? (because of performance concerns, I decided not to use FULLTEXT)