Examples are as follows:
Recommended tutorial: yii framework
$query = model::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pagesize' => '25', ] ]); //获取当前程序执行的sql语句 $query->createCommand()->getRawSql();
For more programming related content, please pay attention to php Chinese website Programming tutorial column!
The above is the detailed content of How to view the sql statements executed by the current program in yii2. For more information, please follow other related articles on the PHP Chinese website!