xProteuSx Posted December 14, 2009 Share Posted December 14, 2009 I have read a few replies to similar questions on this forum, and I only got more confused ... My query looks like this: "SELECT * FROM notes WHERE country = '$country' AND pick = '$pick' AND year = '$year'" I need the pick='$pick' to be case sensitive. I have lots of instances where I have data like '1a' and '1A' but they are not the same. In the database, 'pick' is a varchar data type, and the '$pick' php variable is a string. Is there an easy way to do this? There's got to be ... Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/185023-case-sensitive-select-statement/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2009 Share Posted December 14, 2009 http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html Quote Link to comment https://forums.phpfreaks.com/topic/185023-case-sensitive-select-statement/#findComment-976672 Share on other sites More sharing options...
xProteuSx Posted December 14, 2009 Author Share Posted December 14, 2009 Thanks for your reply PFMaBiSmAd. I actually figured out an easier way: I went into phpMyAdmin and changed the collaction of the 'pick' column from latin_swedish_ci to utf_bin. I think that forces all SELECT queries to handle the data from the column as binary data. Anyways, it worked, but I do thank you for your reply! Quote Link to comment https://forums.phpfreaks.com/topic/185023-case-sensitive-select-statement/#findComment-976673 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.