Skip to content

Instantly share code, notes, and snippets.

@Alexander-Pop
Created June 11, 2019 15:01
Show Gist options
  • Save Alexander-Pop/ddb40cb61fdad1ebd994c2d5dda2d381 to your computer and use it in GitHub Desktop.
Save Alexander-Pop/ddb40cb61fdad1ebd994c2d5dda2d381 to your computer and use it in GitHub Desktop.
Magento - Database Query
<?php
$sql = "SELECT sku FROM catalog_product_entity";
$data = Mage::getSingleton(‘core/resource’) ->getConnection(‘core_read’)->fetchAll($sql);
if(!$data){
echo 'empty';
}else{
foreach ($data as $data){
echo $data['sku'].'Some description';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment