如何查找包含大写或小写非拉丁短语的结果?(PHP、MySQL)

如何查找包含大写或小写非拉丁短语的结果?(PHP、MySQL),php,mysql,character,sql-like,Php,Mysql,Character,Sql Like,我有一些关于非拉丁字符的问题 查询: SELECT * FROM table WHERE name LIKE '%{$phrase}%' PHP: 演示数据库: Asomething (in the db stored as Asomething) asomething (in the db stored as asomething) Äsomething (in the db stored as Äsomething) äsomething (in the db stored as äs

我有一些关于非拉丁字符的问题

查询:

SELECT * FROM table WHERE name LIKE '%{$phrase}%'
PHP:

演示数据库:

Asomething (in the db stored as Asomething)
asomething (in the db stored as asomething)
Äsomething (in the db stored as Äsomething)
äsomething (in the db stored as äsomething) 
无论我键入a还是a,我都会得到我想要的结果-这两个结果,但是。。。 如果我键入Ä,我只会得到一个包含大写字母的结果。我怎样才能同时得到它们呢


编辑:我使用排序规则utf8\u general\u ci

只需始终将搜索查询小写即可

SELECT * FROM table WHERE LOWER( name ) LIKE '%{$phrase}%'

尝试使用
mbstrtolower($phrase'UTF-8')

什么是排序规则设置?您想在php中尝试
mb
函数吗?“一直使用Utf-8”?在表中使用什么字符集和排序规则?您应该将其全部设置为UTF-8。如果副本无法解决您的问题,则可以重新打开页面。现在,你有责任证明你一直在执行建议。当然,要使用事先准备好的陈述。是的,当然…;)这个对我来说没什么用。我知道准备好了,但这里不是。但谢谢你的关心。尽管我之前发表了评论,但这不应该是解决办法。@mickmackusa-hmm。。可以为此编写特定函数。如果搜索不敏感,则似乎不需要重新编译。
SELECT * FROM table WHERE LOWER( name ) LIKE '%{$phrase}%'