我一直在尝试从我的表中连接两列并对它们执行 LIKE
这是mysql查询:
SELECT * FROM stops WHERE CONCAT_WS(name, ' ', desc) LIKE
'%This%' AND CONCAT_WS(name, ' ', desc) LIKE '%is%' AND
CONCAT_WS(name, ' ', desc) LIKE '%a%'
AND CONCAT_WS(name, ' ', desc) LIKE '%test%'
当我通过我的 php 代码或 phpmyadmin 运行它时,我收到以下错误:
Illegal mix of collations (utf8_bin,NONE) and
(utf8_general_ci,COERCIBLE) for operation 'like'
我一直在检查有关此主题的类似问题,并看到很多答案都被告知要更改数据库的排序规则。
我已经将所有数据库、表和字段整理更改为 utf8_general_ci
当我在 Navicat 中运行相同的查询时,它工作得很好。
我在这里错过了什么吗?
谢谢!