How to Get Data from Custom Table in Magento 1.9

magento-1.9

How to get all value of Custom table with image

Table name : imguplaod column name : img

Best Answer

you can get all data with below query

$connectionresource = Mage::getSingleton('core/resource');   
$readconnection = $connectionresource->getConnection('core_read'); 

$allrecord = $readconnection->select()->from(array('imguplaod'=>'imguplaod'));

$alldata =$readconnection->fetchAll($allrecord);

foreach($alldata as $img)
   {
     echo $img['img'];
   }
Related Topic