Are you wanted to get last executed sql query in yii2, we can use:
$query = new Country::find()->where('id=1'); echo $query->createCommand()->sql;
or to get the SQL with all parameters included try:
$query->createCommand()->getRawSql()
Are you wanted to get last executed sql query in yii2, we can use:
$query = new Country::find()->where('id=1'); echo $query->createCommand()->sql;
or to get the SQL with all parameters included try:
$query->createCommand()->getRawSql()