php - zend_db_select join using 3 or more tables -


so zend_db_select has methods

  `joinusing(table, join, [columns]) , joininnerusing(table, join, [columns])`    `joinleftusing(table, join, [columns])`    `joinrightusing(table, join, [columns])`    `joinfullusing(table, join, [columns])` 

etc

but if want join 3 or more tables (eg many many association)....eg: query:

 select * (j left join e on j.id = e.eee) left join w on w.www = e.id 

how go doing zend_db_select

try doing ... not sure works 2 fields have not tried 3 fields

$dbmodel->select(false)     ->setintegritycheck(false)     ->from(array('t1' => 'table1'))     ->joinleft(array('t2' => 'table2'),                                                      't1.somefeild = t2.somefeild')     ->joinleft(array('t3' => 'table3'),                                                      't2.somefeild = t3.somefeild') 

you try build query, , can check query die((string)$select)


Comments

Popular posts from this blog

Delphi Wmi Query on a Remote Machine -