MySQL query BOOLEAN MODE case sensitivity

My search is case sensitive, but I want it to be case insensitive. In MySQL, my database and table are set to utf8_general_ci. The search is still case sensitive. I did some research, and the reason for this seems to be BOOLEAN MODEin my request. Is there any way to do this case insensitive? so no matter how I type any word with any sensitivity, will it always appear in the search results?

SELECT 
        s_cost_sheet.partnumber,
        s_cost_sheet.description,
        s_cost_sheet.price,
        s_cost_sheet.notes

    FROM s_cost_sheet
    WHERE MATCH ( partnumber, description, price, notes ) 
    AGAINST('%".$search."%' IN BOOLEAN MODE) ORDER BY partnumber, description, price, notes ASC";

I checked the search in phpMyAdmin and it works no matter how to type the word, it could be Plate, PLATE, plaTE. Everything is working fine, so there must be something in it that causes the problem.

+5
source share
2 answers

If one of the columns is of type int or numeric, then the search becomes case sensitive. Also there is no need to use% in the search string

+1
source

TRY changing the table and column to utf8_general_ci, and you don't need to use a wildcard %withFULL TEXT Search

RECOMMENDATIONS Also avoid using a large number of columns with a sentence ORDER BYif you need faster results.

0
source

All Articles