我有这个工作正常的测试查询:
select `name` from `Role` as rl, `UserRole` as ur
WHERE rl.id = ur.roleId AND ur.userId = '1'
结果:'test'
我正在尝试使用 Zend_Table 做同样的事情,但我似乎做错了。这就是我的工作:
$usrRole = new Schema_UserRole(array ('db' => $db));
$role = new Schema_Role(array ('db' => $db));
$select = $role->select();
$select
->setIntegrityCheck(false)
->from(array ('rl' => $role))
->join(array ('ur' => $usrRole), 'rl.id = ur.roleId')
->where('ur.userId = ?', '1');
$rowset = $role->fetchRow($select);
$out = $rowset->toArray();
结果:''
谢谢!