I want to use a yii2 query in which I want to check a not equal to condition. I tried like this but it didn\'t give the desired results. How do I do it?
yii2
The better and safe way to apply a condition.
Booking::find()->where('tour_id = :tour_id and id != :id', ['tour_id'=> $chk->tour_id, 'id' => $id])->all();