Show raw SQL query

You are viewing revision #1 of this wiki article.
This is the latest version of this article.

Here's a quick tip to dump the SQL for query.

$query = new Books::find()->where('author=2');
echo $query->createCommand()->sql;

or to get the SQL with all parameters included try:


Thanks to

13 0
Viewed: 106 871 times
Version: Unknown (update)
Category: FAQs
Written by: darioo
Last updated by: darioo
Created on: Jan 14, 2017
Last updated: 2 years ago
Update Article


View all history