You can use below mentioned code

    //database read adapter 
    
    $read = Mage::getSingleton('core/resource')->getConnection('core_read'); 
    
    $results = $read->fetchAll("select * from your_tablename"); 
    foreach($results as $r)
    {
        var_dump($r);
    }

[For more read here. ][1]


  [1]: http://www.codexpedia.com/magento/magento-direct-mysql-query-for-create-read-update-and-delete/