Query in Magento

<?php
$resource = Mage::getSingleton(‘core/resource’);
$readConnection = $resource->getConnection(‘core_read’);
$query = ‘SELECT * FROM files where prod_id=’.$file_id;
$results = $readConnection->fetchAll($query);
if(!empty($results)){
echo “Download Files”;
foreach($results as $resultsfile){
?>
<br/><a href=”http://www.infinityinfosystem.com/download.php?filename=<?php echo $resultsfile[‘prod_file’];?>”><?php echo $resultsfile[‘file_title’];?></a>
<?php }}?>

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *