views:

169

answers:

1

Hi,

How can I do a join such as :

LEFT JOIN table1 t1 ON t1.foo = t2.bar AND tl.baz = t2.bat

What I'm looking for is the syntax for adding a second join constraint to the leftJoin() method using Zend_Db_Select in the Zend Framework.

Thanks,

+2  A: 

Try this

$select = $db->select()
    ->from(array('t1' => 'tab1'))
    ->joinLeft(array('t2' => 'tab2'), 't1.foo = t2.bar AND t1.baz = t2.bat');
RaYell