Answer the question
In order to leave comments, you need to log in
How to create a reverse like query in Yii2?
select * from [table] where 'www.site.ru' like [table].[url]
TABLE::find()->where(['like', 'www.site.ru' , 'url']
builds incorrect select
select * from [table] where [www].[site].[ru] like [table].[url]
Answer the question
In order to leave comments, you need to log in
A little embarrassing
reverse like, what's this? But it probably means this:
$table_name = 'tapki';
$column_name = 'name';
$query_string = 'паралоновые';
$query = new Query();
$result = $query
->from($table_name)
->andWhere(['like', $column_name, $query_string])
->all();
print_r($result);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question