Urkman
(Stefan Sturm)
1
Hello,
at one point I build an complex ActiveQuery, and as it is not working as expexted, I would like to output the generated SQL.
But, how can I do this? I don’t want to log all queries, I just want something like this:
echo $query->sql
Thanks,
Urkman
jaszczomp
(E Kawalec)
3
try this one:
$items=Client::find()
->where(['account_id' => $params['account_id']])
->prepare(Yii::$app->db->queryBuilder)->createCommand()->getSql();
the result will be: (w/o echo)
"SELECT …