views:

182

answers:

1

Hello, i am using Join query in zend.. like

$select = $table->select()
                         ->from(array('e' => 'EducationHistory'),
                                array('status_DataDictionary_id'))
                             ->join(array('r' => 'ReportOrder'),
                                    'e.id = r.EducationHistory_id',
                                    array('reportOrderStatusId' => 'r.status_DataDictionary_id'))
                        ->where('r.orderBy_Organization_id = ?', 4) 
                        ->where('r.orderBy_Person_id = ?', 1)            
                        ->group('e.enrollno');

and to do that i take help from http://framework.zend.com/manual/en/zend.db.select.html

but when i try to run that query an error occurs which say me that

Select query cannot join with another

could any one help me.? Thanks in advance.... :)

table

+3  A: 

Because Zend_Db_Table provides row gateway functions, which don't work if you join on other tables, you have to state that you are willing to give it up. Simply make a call to setIntegrityCheck and it will work:

$select->setIntegrityCheck(false);
David Caunt