Receiving NULL as value when I called this SQL statement (the record exists in the MySQL DB). How can use the LIKE function in Yii2? Thanks.
$command = $connection->createCommand("SELECT user_id
FROM User
WHERE name LIKE '%:_username%'");
$command->bindParam(':_username',$this->username);
$this->id_user = $command->queryScalar();
$command->execute();