Home  >  Article  >  PHP Framework  >  yii2 uses the inequality sign to query

yii2 uses the inequality sign to query

王林
王林Original
2020-02-26 13:54:294657browse

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([&#39;<>&#39;,&#39;cancel_date&#39;, $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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn