Reputation: 167
How to perform a case in-sensitive search on a case sensitive MySQL database?
For example, name = Test & name = test.
then the query returns both Test & test.
How to make a query for this..??
Upvotes: 0
Views: 74
Reputation: 9034
$query = "SELECT * FROM table WHERE LOWER(name) = '" . strtolower($name) . "'";
Upvotes: 1
Reputation: 204746
try
select * from your_table
where `name` = 'test'
COLLATE latin1_general_ci
or
select * from your_table
where `name` = 'test'
COLLATE utf8_general_ci
Upvotes: 3