How to use Join in Zend Framework

徘徊边缘 提交于 2019-12-29 01:44:12

问题


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


回答1:


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);


来源:https://stackoverflow.com/questions/2311481/how-to-use-join-in-zend-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!