mercredi 9 avril 2014

Keeping text upper and lower case in MySql


Vote count:

0




I understand the title can be confusing, was having trouble wording it. If Someone can come up with a better phrasing, feel free to change it.


When I pass in values to the database in MySQL, the 'case' of the text is passed in all well and good, as well as when I retrieve it, So for example:



Stored in the Db, and when retrieved
Username: Ben
Password: PassWord


But when I query it, I can search for



SELECT * FROM TableName WHERE Username = 'ben' AND Password = 'password';


And there is no restriction on font case. Is there a way to set it so that if the above query is used, it will return nothing, but if I use



SELECT * FROM TableName WHERE Username = 'Ben' and Password = 'PassWord';


ONLY this will return the data?



asked 55 secs ago

Ben

367





Aucun commentaire:

Enregistrer un commentaire