-3

Here in this code i have to display all the records from the Table(cust_college). but this function is returning me only 1'st row of that table not other rows.please tell me solution

$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$a = "SELECT * from cust_college";

$qry = $read->query($a);
$res = $qry->fetch(PDO::FETCH_ASSOC); //fetch row
foreach ($res as $payment) {
    echo $payment = $res[college];
    echo $payment = $res[value_id];
    echo $payment = $res[shop_id];
    echo $payment = $res[cust_address];
}

$store = Mage::app()->getStore()->getCode();
hakre
  • 193,403
  • 52
  • 435
  • 836
Supriya
  • 97
  • 3
  • 11

1 Answers1

0
$result = $read->getSelect()->getAdapter()->fetchAll('SELECT * from cust_college');
Guerra
  • 2,792
  • 1
  • 22
  • 32