Skip to content

Instantly share code, notes, and snippets.

@Bat-Chat
Created July 30, 2016 23:04
Show Gist options
  • Save Bat-Chat/c6a582584c558d6339a793c7aa81822b to your computer and use it in GitHub Desktop.
Save Bat-Chat/c6a582584c558d6339a793c7aa81822b to your computer and use it in GitHub Desktop.
запись в базу нативным sql-ом
запись в базу нативным sql-ом
$writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
$table = $resource->getTableName('catalog/product');
$currentTime = date('Y-m-d H:i:s', time());
$query = "UPDATE {$table} SET column = column + 1 WHERE updated_at = {$currentTime}";
$writeConnection->query($query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment