1

How to get all value of Custom table with image

Table name : imguplaod column name : img

1 Answer 1

2

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'];
   }
6
  • I tried this but i want all images in that table
    – Magento 2
    Commented Mar 25, 2016 at 11:03
  • this will get all record from databse Commented Mar 25, 2016 at 11:04
  • Yes i understand but i want img column and with image in frontend i need to display
    – Magento 2
    Commented Mar 25, 2016 at 11:05
  • updated the code............... Commented Mar 25, 2016 at 11:07
  • No luck not dispaly
    – Magento 2
    Commented Mar 25, 2016 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.