Case Insensitive MySQL Search?

MySQL case insensitive search?

For my site search, what is the most efficient way to request my db for a word / phrase, regardless of the case?

+5
source share
1 answer

If your database / table is not configured using case-insensitive matching, you need to add something like this to the query COLLATE utf8_general_ci. (Suffix _cimeans case insensitive.)

Take a look at the documentation: 9.1.7.1. Using COLLATE in SQL statements :

COLLATE . COLLATE SQL.

+7

All Articles