Home > Article > PHP Framework > yii2 uses the inequality sign to query
Yii2 Active Record query conditions use the inequality sign, which requires the use of
operator format: [operator, operand1, operand2, ...]
Operator format: [operator, operand 1, operand 2, ...]
(Recommended tutorial: yii framework)
Demo code:
$details = MovieShows::find()->where(['movie_id'=>$id]) ->andWhere(['location_id'=>$loc_id]) ->andWhere(['<>','cancel_date', $date])->all();
From the last line of code in the demonstration, you can see that the first element is the operation symbol, the second element is the field in the data table, and the third element is the value.
For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!
The above is the detailed content of yii2 uses the inequality sign to query. For more information, please follow other related articles on the PHP Chinese website!