I've got a hashtags table in my mysql db, with a string(512)
column called tag
. I want to do a case sensitive search using Yii2's ActiveQuery, like this:
$expTags = ['one','two','three'];
Hashtag::find()->where(["IN","tag",$expTags])->select(["id"]);
In mysql, this usually means prefixing BINARY outside every value, or prefixing the column name. I tried both, I even tried "IN BINARY", nothing worked.
How to do this? I need case sensitive search, and I don't want to modify the table / column collation just to do this.