开发者

SQL statement queries parameters become case sensitive how so?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜