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();
(Visited 66 times, 1 visits today)