This question already has an answer here:
- How to log all Magento SQL? 4 answers
I am facing trouble to print query while saving data from my controller file.
I am developing a custom module where I am required to save current date and time when form is submitted. The user is not inputting the date.
$timeStamp = date("Y-m-d H:i:s"); $model->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $timeStamp )); $model->save();
Here when I print my
$model->getData(); I see created_time value but its not reflecting in DB
Also I tried with below code to print SQL query but it says
Call to a member function printLogQuery() on a non-object.
// For printing the whole SQL with the Collection var_dump($model->printLogQuery(true)); // For printing only the SQL var_dump($model->__toString());
How can I print INSERT query for above scenario ?