Pages

Sunday, August 11, 2013

Get Connection & Custom Query Execution in Magento

For database connection
$write = Mage::getSingleton('core/resource')->getConnection('core_write');

$qry=”Select * from tablename”;
$execute=$write->query($qry);
$fetch=$execute->fetch()
To get the Row Count
$count=$execute->rowCount();

No comments:

Post a Comment