I'm running a SQL query on my mysql database but for some reason its case sensitive like if an entry exists as 'NAME 开发者_StackOverflow中文版= Andrew' running a sql query like:
SELECT * WHERE NAME Like 'and%'
Doesn't work but
SELECT * WHERE NAME Like 'And%'
does work? WHat gives I'm running a php mysql set up here...
It depends on your field's collation. For instance if you use utf8_general_ci for the 'name' field, it would be case insensitive on that query.
From the MySQL Dev Site
"Normally, if any expression in a string comparison is case sensitive, the comparison is performed in case-sensitive fashion. "
Normally, if any expression in a string comparison is case sensitive, the comparison is performed in case-sensitive fashion.
http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
Yet, someone thinks it is a bug http://bugs.mysql.com/bug.php?id=8847
精彩评论