I created 2 textension in magento along with 2 different tables. First extension store data in table-1 while second second extension store data in table-2. Now i want to display data in first extension by LeftJoin. It show data without leftjoin from first table but not showing data with leftjoin from both the tables.
This code in block.php
public function methodblock() { $collection = Mage::getModel('test/test')->getCollection(); $returnCollection = $collection->getSelect() ->joinLeft('magento_answer', 'id_pfay_test=question_id', array('*'), null , 'left'); return $returnCollection; } On Layout side. dislplaydata.phtml
<?php $collection = $this->testmethodblock(); foreach($collection as $rows { echo $rows ->getData('name'); }
main_table.*,magento_answer.* FROMmagento_pfay_testASmain_tableLEFT JOINmagento_answerON id_pfay_test=question_id . This query is running properly on mysql db.