How can I do a wildcard search using bindValue(:name, $name) in LIKE condition given this query:
$post = Yii::$app->db->createCommand('SELECT * FROM fruits WHERE name LIKE %:name%')
->bindValue(':name', 'apple')
->queryOne();
I did this and it does as I need.
$post = Yii::$app->db->createCommand('SELECT * FROM fruits WHERE name LIKE :name')
->bindValue(':name', '%apple%')
->queryOne();