khushal
(Khushal Fadiya)
1
Hello everyone!!!
I have written one custom query in YII and I want to pass NOW() function of MySQL as one value inside it.
Query :
Yii::app()->db->createCommand()->insert(‘temp_log’, array(
'log_name'=>$name,
'log_date'=>'NOW()',
'log_id'=>$id,
));
This query Running fine but now() function gives Incorrect result as "0000-00-00 00:00:00", It is not storing current Date-Time…
Thanks in Advance!!!
khushal
(Khushal Fadiya)
2
Got The answer :
new CDbExpression(‘NOW()’)
Gives the correct value.