Andy Jarrett // Code. Develop. Create.

Case sensitive selects in MySQL

There has been a couple of reasons recently that I needed to do a look up on a MySQL table using a case-sensitive Select statement. Its actually as easy as using "LIKE BINARY" instead of "LIKE" e.g.SELECT username, passwordFROM tablenameWHERE password LIKE BINARY 'SOmE PAssWOrD'Obviously if you are on a CFML engine don't forget
<cfqueryparam cfsqltype="cf_sql_varchar" value="SOmE PAssWOrD" />

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️