在此代码中,我必须显示表中的所有记录(cust_college)。但是这个函数只返回那个表的第1行而不是其他行。请告诉我解决方案
$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();
答案 0 :(得分:0)
$result = $read->getSelect()->getAdapter()->fetchAll('SELECT * from cust_college');