on my admin panel appear :
Notice: Undefined offset: 0 in /var/www/main/app/code/local/Sm/Megamenu/Helper/Data.php on line 213
how to resolve?
public function getParentIdNode($id, $groupId, $nametable, $myLeft, $myRight='' ){
$query = "
SELECT * FROM {$nametable}
WHERE (lft < '{$myLeft}' and rgt > '{$myRight}') AND group_id ='{$groupId}'
ORDER BY lft DESC
LIMIT 1
";
// echo $query;die;
try{
$read= Mage::getSingleton('core/resource') ->getConnection('core_read');
$data = $read->fetchAll($query);
// Zend_Debug::dump($data);die;
$item = new Varien_Object();
$item->setData($data[0]); <<====line 213
// Zend_Debug::dump($item);die;
return $item;
}
catch(Exception $e){
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
return;
}
$item->setData($data);
it doesnot have[0]
array