Hi,I want to obtain a field from table 'dirempresasbragaempresas'. So:$empresa = new Empresa();$this->view->rows = $empresa->fetchAll($empresa->select()->setIntegrityCheck(false)->join(array('sae' => 'sectoractividade_empresa'), 'sae.EmpresaNIPC=empresa.NIPC', array())->join(array('sa' => 'sectoractividade'), 'sa.CAE=sae.SectorActividadeCAE', array())->join(array('debe' => 'dirempresasbragaempresas'), 'debe.ID=sa.DirEmpresasBragaEmpresasID', array())->where('empresa.Estado = ?', 'A')->order('rand()')->limit(5, 0));When i do:foreach ($this->rows as $Row){{$Row->Nome}}I can get the value from the field 'Nome' that came from table 'empresa'.When i do:foreach ($this->rows as $Row){{$Row->Descricao}} That is a field from table 'dirempresasbragaempresas', i have the next error:Fatal error: Uncaught exception 'Zend_Db_Table_Row_Exception' with message 'Specified column "Descricao" is not in the row' in /Applications/MAMP/htdocs/BragaDigital/library/Zend/Db/Table/Row/Abstract.php:182Thanks by helping me!!
2008年11月26日星期三
[fw-db] Problem with JOIN
订阅:
博文评论 (Atom)
没有评论:
发表评论