I found on stackoverflow an example of a parameterized like query:
select(…)->from(…)->where(‘name_item LIKE :substr’, array(’:substr’ => ‘%name%’)
But this example is from yii 1.1.*
The above example is still available(and secured) in yii 2.0?
What about this one:
select(…)->from(…)->where([‘like’, ‘name_item’, ‘:substr’], [’:substr’ => ‘%name%’]))
nguyendh
(Duynguyen0511)
2
the yii1 syntax is nolonger valid in Yii2.
check this for full documentation My link on how to use where in Yii2. It has "like" operator as well
Ok, but it does not have examples cu $params parameter.