Hi,
Can I print out the sql statement? because I wanna to test the statement in phpmyadmin
If I got following code, how can I print out the sql statement:
$criteria = new CDbCriteria();
$criteria->addSearchCondition('ten_lc', $keyword, "OR", "LIKE");
$criteria->addSearchCondition('bien_so', $keyword, "OR", "LIKE");
$dataProvider = new CActiveDataProvider('LichChay', array(
'Criteria' => array(
'condition' => 'ngay_kh = :ngayKH OR ma_ct = :maCT',
'order' => 'ma_theo_doi, ngay_kh',
'params' => array(
':ngayKH' => $this->formatDbDate($keyword),
':maCT'=> $congty,
)
),
));
$dataProvider->setCriteria($criteria);
In the end of code, I got $dataProvider variable, and how can I print out sql statement?
Any idea?
Thanks