rado
Posts: 221
|
| Posted: 04/28/2009, 3:39 PM |
|
I know that table and field names are case sensitive in MySQL database, however after long time I realized that the value in my user_password field is not.
Do you know how I can configure mysql db to set my password field to have case sensitive values. This is not the question for PHP forum , but I know that here is so many smart people that could answer my question.
Thanks,
Rado
|
 |
 |
damian
Posts: 838
|
| Posted: 04/28/2009, 3:45 PM |
|
i believe that this is done by setting the BINARY attribute on your password field in the database...
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
melvyn
Posts: 333
|
| Posted: 04/28/2009, 4:49 PM |
|
That's done setting that field collation as Case Sensitive. By default they're as latin1_sweedish_ci (or whatever character set you're using) and set it without _ci.
ALTER TABLE mytable CHANGE my_field VARCHAR( 45 ) CHARACTER SET latin1 COLLATE latin1_general_cs NULL DEFAULT NULL
The above will be latin1_general_cs = Case Sensitive.
ALTER TABLE mytable CHANGE my_field VARCHAR( 45 ) CHARACTER SET latin1 COLLATE latin1_spanish_ci NULL DEFAULT NULL
Tha above will set as Spanish Case Insenstive.
I remember it from a time, long time ago in a post from Walter Kempess.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
rado
Posts: 221
|
| Posted: 04/28/2009, 7:44 PM |
|
Thanks damian and Melvyn.
I run this statement:
ALTER TABLE tenants CHANGE tenant_Password VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_general_cs NULL DEFAULT NULL
and got this error:
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_general_cs NULL DEFAULT NULL' at line 1
I was able to change the charset to "cs" using MySQL Admin, however it applies to whole table, which is not practical in my case.
Rado
|
 |
 |
rado
Posts: 221
|
| Posted: 04/28/2009, 8:00 PM |
|
And this one worked:
ALTER TABLE `tenants` MODIFY `tenant_Password` varchar(50) COLLATE `latin1_general_cs`;
Thanks a lot for respond and help.
Rado
|
 |
 |