Zend加入左警告:选择查询不能与/var/www/myiartz/library/zend/db/select.php



我正在尝试在zend中创建此选择查询:

SELECT `receive`.`itemid`, `receive`.`room` FROM `tm_receive` AS `receive` LEFT JOIN `tm_rooms` ON tm_receive.room = tm_rooms.id

这是我的zend_db_table选择对象:

$select = $this->select()
     ->from(array('receive' => 'tm_receive'),
            array('itemid', 'room'))
     ->joinLeft(array('room' => 'tm_rooms'),
            'receive.room = room.id');

但是我遇到了这个错误: Warning: Select query cannot join with another table in /var/www/myiartz/library/Zend/Db/Select.php on line 1350

我在做什么错?

尝试使用以下方式:

$database = Zend_Db::factory( ...options... );
$database->select()->from(array('receive' => 'tm_receive'),
        array('itemid', 'room'))
 ->joinLeft(array('room' => 'tm_rooms'),
        'receive.room = room.id');

问题是在使用select()时,结果仅限于该表。

最新更新