In Yii2, if you’d like to check if a record exists in a table, use the following code:

[php]
Customer::find()->where( [ ’email’ => ‘jeff@yii2x.com’ ] )->exists();
[/php]

Support this site, share this page:Tweet about this on TwitterShare on RedditShare on LinkedInShare on FacebookEmail this to someone