whiteboikyle Posted June 18, 2008 Share Posted June 18, 2008 Okay so if someone registeres there name in my register script as KyLe and the try logging in they can login as KyLe KYLE kyle etc... so i am trying to make it so they HAVE to enter KyLe so how would you go about doing this? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 18, 2008 Share Posted June 18, 2008 Use === instead of == when comparing the strings. Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 18, 2008 Share Posted June 18, 2008 if you want to do this in PHP, case sensitive comparison can be done using strcmp(), just like in C. if you want to do this in MySQL, then you need to convert the other field as binary to make it case sensitive, example: SELECT 'aB' LIKE BINARY 'aB'; -- returns 1 which is true SELECT 'aB' LIKE BINARY 'ab'; -- returns 0 which is false is that what you mean? Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted June 18, 2008 Author Share Posted June 18, 2008 Yeah i do it through mysql so i will check that! Thanks bluejay! Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted June 18, 2008 Author Share Posted June 18, 2008 wait wait it seems to not work correctly.. unless its bad syntax "SELECT * FROM members WHERE username='".$myusername."' and password='".$encrypt_password."'" So where would i input LIKE BINARY at? Quote Link to comment Share on other sites More sharing options...
Sesquipedalian Posted June 18, 2008 Share Posted June 18, 2008 "SELECT * FROM members WHERE BINARY username='".$myusername."' and BINARY password='".$encrypt_password."'" You just use BINARY. It is put before each value="othervalue" (as shown above). Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 18, 2008 Share Posted June 18, 2008 mysql is case insensitive so you have to get the data from the db first then compare it with the actual string using php Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted June 18, 2008 Author Share Posted June 18, 2008 I also learned that if you set your Collation to latin1_bin it will check it Case Sensitively. teng84: that is not true xD it inputs it case sensitive so when you are comparing the data yes.. But, it wont check the 2 data's using mysql case sensitive unless you have your collation to that.. Thanks DarkWater again for all your help!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.