If you have used the query builder in yii 2.0.8 framework then to get the raw sql generated use the below statement.

$query->andFilterWhere([‘like’, ‘username’, $this->username])
->andFilterWhere([‘like’, ’email_id’, $this->email])
->andFilterWhere([‘registration_date’ => $this->register_date]);
// This is echo the raw query generated
var_dump($query->createCommand()->getRawSql());

Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.