Hey guys,
I know there are a ton of posts about case insensitive queries and I've done my research, but can't find an answer to the specific problem I have which is as follows:
My search page has sudddenly started yielding unpredictable results.
My website is here.
Basically I want users to be able to search for articles based on the text in an article's headline. This needs to be case insensitive as most of the time, the first letter in each word in the headline is capitalised.
(The search box is in the top left hand corner under the logo.)
Another reason for case insensitivity is that the different people who write for the website write thing differently, so for example, users might want to search for GTA, Gta, or gta. And I need all results to be displayed regardless of the search criteria.
Here's where the problem is.
This used to work fine with the following:
$query = "SELECT * FROM tbl_articles WHERE LCASE(headline) LIKE LCASE('%$search_text%');";
However all of a sudden, this is no longer case insensitive.
I have tried using UPPER instead of LCASE and that doesn't work either.
I'm really confused as this used to work fine.