Jump to content

Case Sensitive


d_barszczak

Recommended Posts

MySQL is case [b]in[/b]sensitive, unless there is a configuration option I'm unaware of.

[tt]select * from table where name like 'david%'[/tt] should give you what you want, including dAvidA, DAVIDb, daviDc, etc.

[tt]select * from table where name like binary 'david%'[/tt] should keep 'david' lowercase, resulting in davidA, davidB, davidc, etc.
Link to comment
https://forums.phpfreaks.com/topic/17234-case-sensitive/#findComment-73072
Share on other sites

Ok here is the table in question.

[code]
+-------+-------------+-----------+------+-----+---------+-------+----------------------+---------+
| Field | Type        | Collation | Null | Key | Default | Extra | Privileges          | Comment |
+-------+-------------+-----------+------+-----+---------+-------+----------------------+---------+
| name  | varchar(40) | ascii_bin | YES  |    |        |      | select,insert,update |        |
| age  | int(11)    |          | YES  |    |        |      | select,insert,update |        |
| sex  | varchar(1)  | ascii_bin | YES  |    |        |      | select,insert,update |        |
+-------+-------------+-----------+------+-----+---------+-------+----------------------+---------+

[/code]
Link to comment
https://forums.phpfreaks.com/topic/17234-case-sensitive/#findComment-75552
Share on other sites

ahh so thats my problem.

I have always used an web hosting company to manage my mysql server but this is my test server that i have at home.

I changed it to ascii_bin as i think the default was something like latin_sweedish or something.

So it's the collation.

Shortly after i made the post i realised that i have used case-insensitive queries before.

Thank you for your help
Link to comment
https://forums.phpfreaks.com/topic/17234-case-sensitive/#findComment-75913
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.