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

yii2 uses the inequality sign to query

王林
Release: 2020-02-26 14:32:24
Original
4766 people have browsed it

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();
Copy after login

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!

Related labels:
Statement of this Website
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
Latest Issues
yii2 error connecting to mongodb3.2.4
From 1970-01-01 08:00:00
0
0
0
How to use mongodb to do rbac in yii2
From 1970-01-01 08:00:00
0
0
0
php - yii2-ueditor-widget
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template