Skip to content

Instantly share code, notes, and snippets.

@LordZombi
Created July 15, 2013 14:14
Show Gist options
  • Save LordZombi/6000242 to your computer and use it in GitHub Desktop.
Save LordZombi/6000242 to your computer and use it in GitHub Desktop.
If you want to select from one table but also join with another.
$select= $this->_getTable()->select()->setIntegrityCheck(false)
->from(array('BLG' => 'articles'), array('month' => new Zend_Db_Expr($m), 'count' => new Zend_Db_Expr('COUNT(BLG.id_articles)')))
->joinLeft(
array('LNG' => 'languages'),
'LNG.id_languages = BLG.id_languages',
array('lang' => 'code')
)
->where('LNG.code = ?', $lang)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment