0

我是 Zend 的新手。在我的模型 Default_Model_ApplicationMapper 中,我想使用 db-table Application_Model_DbTable_Application 来运行这样的查询

"Select * from application as a, category as c, user as u where a.user_id = u.id and a.category_id = c.id";

我试过这个:

$table = new Application_Model_DbTable_Application();
$select = $table->select()->from(array('a' => 'application'))
->from(array('c' => 'category'))
->from(array('u' => 'user'))
->where('a.user_id = u.id and a.category_id = c.id');

当然这个东西是行不通的。你能帮我解决这个问题吗?

4

1 回答 1

0

不要使用from(array('a' => 'table'))三次,而是尝试使用from(array('a' => 'table1', 'b' => 'table2', 'c' => 'table3')).

于 2013-05-14T06:58:52.857 回答