To connect database and fetch values from tables in magento.
<?php
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult= $write->query("SELECT fieldname FROM tablename" );
while ($row = $readresult->fetch() )
{
$temp[] = $row['feildname'];
}
?>
<?php
print_r($temp);
?>
<?php
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult= $write->query("SELECT fieldname FROM tablename" );
while ($row = $readresult->fetch() )
{
$temp[] = $row['feildname'];
}
?>
<?php
print_r($temp);
?>
Thanks i got excellent information from U.....
ReplyDelete