Check:
$read = Mage::getsingleton ("Core/resource")->getconnection (' Core_read '); $sql = "SELECT * From ' abc ' "; $result = $read->fetchall ($sql); //fetchrow Find a Add, delete, change $write = Mage::getsingleton ("Core/resource")->getconnection ( ' Core_write '); $sql = "INSERT into ABC (name) VALUES (' Hello ')"; $write->query ($ SQL); Another way: add $write = Mage::getsingleton ("Core/resource")->getconnection (' Core_write ') ; $table = Mage::getsingleton (' Core/resource ')->gettablename (' abc '); $ Write->insert ($table, Array (' name ' = = ' Hello ')); $write = Mage::getsingleton ("core/ Resource ")->getconnection (' Core_write '); $table = Mage::getsingleton (' Core/resource ') Gettablename (' abc '); $write->update ($table, Array (' name ' = = ' abc '), Array (' id=? ') =>3)); Delete $write = Mage::getsingleton ("Core/resource")->getconnection (' Core_write '); $table = Mage:: Getsingleton (' Core/resource ')->gettablename (' abc '); $write->delete ($table, Array (' id=? ') =>3); $read = Mage::getsingleton ("Core/resource")->getconnection (' Core_read '); $table = Mage::getsingleton (' Core/resource ')->gettablename (' abc '); $result = $read->select ()->from (Array (' main_table ' = $table))->where (' Main_table.id=? ', 3)->limit (1); $products = $read->fetchall ($result);
Magento Operations Database