如何在Mysql中使用like运算符搜索法语单词?

French words are saving in to database like-

   Sécurité Informatique

The original word is - Sécurité Informatique

How to search this word using LIKE '%Sécurité Informatique%'

I have already tried mysqli_real_escape_string and

WHERE table.content COLLATE UTF8_GENERAL_CI LIKE '%Sécurité Informatique%'

First you need to insert your data correctly to your database then you can search for it. For doing that you should use correct encoding, which is UTF8 for your usage.

How ? It depends on how you are connected to your database Some examples :

For MySQLi:

mysqli_set_charset($conn, "utf8mb4");

For MySQLi OOP :

$conn->set_charset("utf8mb4");

Also you need to specify you are using UTF-8 In your client side(HTML) with :

<meta http-equiv="Content-type" content="text/html;charset=utf-8" />

The reason why we used utf8mb4 instead of utf8 is utf8 in MySQL is outdated and use 3 bytes but utf8mb4 is the correct utf8 and uses 4 bytes.

Thank you all for your suggestions. The solution I used is similar to,

$temp = "Sécurité Informatique";
$temp = htmlentities($temp);
$temp = htmlspecialchars($temp);
WHERE table.content COLLATE UTF8_GENERAL_CI LIKE '%".$temp."%'