How do I ignore the difference between uppercase and lowercase when searching with mysql

advertisements

How can I ignore the difference between upper and lower case when searching with mysql


Do something like this:

SELECT user
FROM users
WHERE UPPER( user ) = UPPER( 'moustafa' );

Basically you're converting your result to one case and comparing against the search term which is also converted to upper case, effectively ignoring case.