Answer the question
In order to leave comments, you need to log in
How to make SQL query with LIKE in YII2?
Doing a site search with LIKE? it turns out this line:
$query = Course::find()->where(['like', 'name', $q]);
Answer the question
In order to leave comments, you need to log in
Course::find()->where(['like', 'name', $q])
->orWhere(['like', 'content', $q])
->orWhere(['like', 'keywords', $q])
->orWhere(['like', 'description', $q])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question