Tuesday, April 10, 2018

Yii2 limit

Create a new instance of yii db Query.

Offset() define which is starting point and limit() define the number of rows.

Limit Query in Yii2

$query = (new Query())->select(['id'])->from('user');
$query->limit(10)->offset(10);

No comments:

Post a Comment