Yii count query records


Yii count query records Syntax And Example : Yii Count query result as below.


Yii join query records example with Syntax

$count = (new \yii\db\Query())
    ->from('users')
    ->where(['id' => '100'])
    ->count();

Which will generate the following query as below.

//Select count(*) from users where id=’100′;

where $id = 5;


Advertisements

Add Comment

📖 Read More