Magento is a complete and awesome MVC application. It’s fully moduler and easy to extend its features and functionality. All the CRUD operations are performed using the modules, model classes. But many a time it requires a developer to execute the db query in traditional form.
Here is the list of methods and queries.
In magento to Read or Write any query we need database connection.
<?php //database read adapter $read = Mage::getSingleton('core/resource')->getConnection('core_read') //database write adapter $write = Mage::getSingleton('core/resource')->getConnection('core_write'); ?>
These connections return special instances of the Mage_Core_Model_Resource class, that contains functions used to execute raw Database Queries.