I'm trying to build a join with Zend_Db_Table.
Because it does not work at all, i tried the example from the doc, but it does also not work as expected:
$table = new Bugs(); // retrieve with from part set, important when joining $select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART); $select->setIntegrityCheck(false) ->where('bug_status = ?', 'NEW') ->join('accounts', 'accounts.account_name = bugs.reported_by') ->where('accounts.account_name = ?', 'Bob'); //$rows = $table->fetchAll($select); $
select
->__toString() gives me a query for starting like SELECT accounts.* FROM accounts (NO JOIN !?) What I did expect, was to get a query for table Bugs: SELECT bugs.* FROM bugs INNER JOIN accounts ON ... Do joins in Zend_Db_Table work?
没有评论:
发表评论