sql - Zend how do I create a left join -


how turn left join query:

select advertisercontest.*, advertiseraccount.advertiserid, advertiseraccount.companyname advertisercontest left join advertiseraccount on advertiseraccount.loginid = advertisercontest.loginid  advertisercontest.golive not null; 

into left join in zend?

you follows:

    $db = zend_db_table::getdefaultadapter();      $select = $db->select();     $select->from('advertisercontest', '*')             ->joinleft(                     'advertiseraccount',                     'advertiseraccount.loginid = advertisercontest.loginid',                     array('advertiseraccount.advertiserid', 'advertiseraccount.companyname')                     )             ->where('advertisercontest.golive not null');;      $result = $db->fetchall($select);      var_dump($result); 

hope ok.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -