What is the error when you query or the like?

Here's the query itself

$search = Search::find()->where(['or like', ['name','description'], $query])->limit(30);

Gives you this error
strpos() expects parameter 1 to be string, array given

in documentation is described as
or like: similar to the like operator, just LIKE assertions are combined by using the OR operator if the second operand is represented by an array.
July 9th 19 at 13:16
1 answer
July 9th 19 at 13:18
"... if the SECOND operand is represented by an array."

'or like' operator
['name','description'] - the FIRST operand
$query - the SECOND operand.

You know?

or like not in order by several columns to search. Or like to one column OR two conditions to do.

Your slice need to write:

Search::find()->orWhere(['like', 'name', $query])->orWhere(['like', 'description', $query])
or
Search::find()->where(['or', ['like', 'name', $query], ['like', 'description', $query]]) - Helois commented on July 9th 19 at 13:21

Find more questions by tags Yii