<?php
$hint = 'dell';
$sql="SELECT p.`entity_id`, pv.`value` as name,
GROUP_CONCAT(DISTINCT(pm.`value`) SEPARATOR ', ') as imagesPath
FROM `catalog_product_entity` as p
INNER JOIN `catalog_product_entity_varchar` as pv
ON pv.`entity_id` = p.`entity_id` and pv.`attribute_id` = 71
LEFT JOIN `catalog_product_entity_media_gallery` as pm
ON pm.`entity_id` = p.`entity_id` and pm.`attribute_id` = 88
WHERE pv.value LIKE '".$hint."'";
foreach($readConnection->fetchAll($sql) as $orders) {
?>
<img src="<?php echo Mage::getBaseUrl('media').'catalog/product'. $orders["imagesPath"].''; ?>" alt="" />
<?php
}
?>
The output of this code is
<img src="http://127.0.0.1/magento/media/catalog/product/2/_/2.jpg" alt="" />
It shows me just the path of the image but i want an image in output on the browser.