Skip to content

Instantly share code, notes, and snippets.

@roscius
Created May 8, 2013 17:50
Show Gist options
  • Select an option

  • Save roscius/5542196 to your computer and use it in GitHub Desktop.

Select an option

Save roscius/5542196 to your computer and use it in GitHub Desktop.
Magento DB Functions
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$results = $readConnection->fetchCol('SELECT somecolumn FROM sometable');
foreach ($results as $result) {
echo $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment