Magento: Getting more than one records from core_config_data table

· kalpesh

To select any particular record from core_config_data table in magento is quite simple.

Mage::getStoreConfig(‘sales_email/order/template’);

But what if you want all the data pertaining to sales order email or for any other thing stored in magento’s config table? You may need other data like “enabled”, “identity”, “guest_template”, “copy_to” which can accomplish otherwise in 5 requests.
So here is how you should write the code to get all the data for some particular expression as per your need.
$qrySalesOrder = Mage::getModel(‘core/config_data’)->getCollection()->addFieldToFilter(‘path’,array(‘like’=>’sales_email/order/%’));  
//Mage::log($qrySalesOrder);

#core_config_data #magento