I want to write a custom query in magento website.
I created a file test.php in my magento root folder & written a custom query
<?php
$read= Mage::getSingleton('core/resource')->getConnection('core_read');
$value=$read->query("Select * from catalog_product_flat_1");
$row = $value->fetch();
echo "<pre>";print_r($row);echo "</pre>";
?>
But it is not giving me any results.Please guide me.
Try this:
In order to test, you can create sandbox.php file in root of your magento installation and paste the following code:
and call from url as: