Jump to content

Case Sensitive SELECT Statement


xProteuSx

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/185023-case-sensitive-select-statement/
Share on other sites

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.