zend framework - add multi tables in from() zend_db_select -
i have select multi tables using zend_db_select sql :
select t1.id,t2.ids, t3.uid table1 t1,table2 t2, table3 t3
this code used :
$subquery = $this->getdbtable ()->select ()->setintegritycheck ( false ) ->from(array('t1'=>'table1','t2'=>'table2','t3'=>'table3'),array('t1.id','t2.ids','t3.uid')) ->query() ->fetchall();
so have message error t2.ids not in column list because zend_db_select take first table
any solution resolve problème ? thaks
you can use cross join with:
$subquery = $this->getdbtable ()->select ()->setintegritycheck ( false ) ->from(array('t1'=>'table1'),array('t1.id')) ->joincross(array('t2'=>'table2'),array('t2.ids')) ->joincross(array('t3'=>'table3'),array('t3.uid')) ->query() ->fetchall();
Comments
Post a Comment