title: How to do custom query in magento?
body: <p>I want to write a custom query in magento website.</p>
  
  <p>I created a file test.php in my magento root folder &amp; written a custom query</p>
  
  <pre><code>&lt;?php
   $read= Mage::getSingleton('core/resource')-&gt;getConnection('core_read');
   $value=$read-&gt;query("Select * from catalog_product_flat_1");
   $row = $value-&gt;fetch();
   echo "&lt;pre&gt;";print_r($row);echo "&lt;/pre&gt;";
  ?&gt;
  </code></pre>
  
  <p>But it is not giving me any results.Please guide me.</p>