我为什么要做到这一点:
An error occurred
Application error
Exception information:
Message: Select query cannot join with another table
在试图加入两个表格时?
我的模型中载有这一行文法,该模型涵盖Zend_Db_Table_Abstract。
public function getProjects() {
$select = $this->select()
->from(array( sub => $this))
->join(array( main => main_projects ), main.mai_id = sub.mai_id );
return $this->fetchAll($select);
}
我在我的控制器中使用:$ this->view->entries =$this->sub_projects->getprojects(
。
我为什么会犯这一错误? 我只是想简单地加入。
SELECT sub.*, main.mai_title FROM sub_projects AS sub INNER JOIN main_projects AS main ON sub.mai_id = projects.mai_id;
enter code here