The following data I have to insert using save(). The data is from html table.
Array
(
[Test] => Array
(
[1] => Array
(
[patient_id] => 58
[dt_test] => 2012-06-04
[name] => dfg
[result] => 34
)
[2] => Array
(
[patient_id] => 58
[dt_test] => 2012-06-18
[name] => dsfg
[result] => 76
)
)
) The id is the primary key of 'test'
There is no validation error. But not any row is inserting into the table 'test'. How can I check the sql query used to insert the data. My db is postgres and version is 1.3
To see queries you need to enable debug mode. In /cakephp/app/config/core.php you have to set debug level:
Configure::write('debug', 2);
then you can print all queries by putting this code in your view file:
<?php echo $this->element('sql_dump'); ?>
If you prefer to display them from controller, then put this line after save():
debug($this->Test->getDataSource()->getLog(false, false));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With