dadamssg87 Posted October 3, 2011 Share Posted October 3, 2011 How do i query rows with exact matches, including upper versus lower case letters? I have a column called 'code'. It's used for storing that rows unique random string. Right now, "lkbXN" and "lkbXn"(notice the N's) are the same thing. How do i make the query only pull up exact matches? Quote Link to comment https://forums.phpfreaks.com/topic/248352-comparing-with-upper-and-lower-case-letters/ Share on other sites More sharing options...
Pikachu2000 Posted October 3, 2011 Share Posted October 3, 2011 Look HERE for information. If you aren't able to make any progress with it, let us know. Quote Link to comment https://forums.phpfreaks.com/topic/248352-comparing-with-upper-and-lower-case-letters/#findComment-1275349 Share on other sites More sharing options...
dadamssg87 Posted October 3, 2011 Author Share Posted October 3, 2011 I read that i am still confused. I don't undersand collation. I'm using Mamp. It defaults all varchar to "latin1_swedish_ci". Do i need to change that or write a different query that uses "collate"? Query in question: SELECT * FROM Add_ons WHERE code = '$code' Quote Link to comment https://forums.phpfreaks.com/topic/248352-comparing-with-upper-and-lower-case-letters/#findComment-1275354 Share on other sites More sharing options...
dadamssg87 Posted October 3, 2011 Author Share Posted October 3, 2011 wait..just kidding. I switched it to "latin1_bin" and that seemed to do the trick. Is that the correct way to go about doing that? Quote Link to comment https://forums.phpfreaks.com/topic/248352-comparing-with-upper-and-lower-case-letters/#findComment-1275357 Share on other sites More sharing options...
fenway Posted October 3, 2011 Share Posted October 3, 2011 You don't need to switch the column, unless you always mean that -- you can just collate in your query. Quote Link to comment https://forums.phpfreaks.com/topic/248352-comparing-with-upper-and-lower-case-letters/#findComment-1275370 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.