here is some minor question but it always bother me while doing the code with magento.
$resource = Mage::getSingleton('core/resource');
$write = $resource->getConnection('core_write');
$table = $resource->getTableName('your/model');
$write->delete(
$table,
['entity_id IN (?)' => [123, 456]]
);
$write->update(
$table,
['column_1' => 3, 'column_2' => 4],
['entity_id = ?' => 123]
);
If I use above code to write into DB and I am not sure which query will be formed actually. How would I print the formed SQL through above write object.
I just know this one:
echo $collection->getSelect()
In which I can get the select query printed on the screen.
Can you please suggest me so that I can get the query which is going to execute or which is executed in last.
Thank you :)