Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在区分大小写的 MySQL 数据库上执行不区分大小写的搜索? 例如,名称 = 测试 & 名称 = 测试。 然后查询返回测试和测试。 如何对此进行查询..??
尝试
select * from your_table where `name` = 'test' COLLATE latin1_general_ci
或者
select * from your_table where `name` = 'test' COLLATE utf8_general_ci
$query = "SELECT * FROM table WHERE LOWER(name) = '" . strtolower($name) . "'";