convert sql query to Zend DB query -


I have the tow table: articles, subclasses How to change this query Join the DB query < P> $ Sql ​​= "

Select Article . *, subclasses . name_rbic AS C_card_name_Archic , sub-classes . name_login AS sub-cnt_name_english , article . sub_category_id as sub_categories_id code> to article LEFT JOIN subcategories ON article . sub_category_id = sub-tags . id WHERE article . active = 1 ";

Please help with

Thanks

< P> This should do the trick:
  $ db- & gt; Select () - & gt; From ('article', array ('*', 'sub_categories_id' = & gt; 'sub_category_id') - & gt; (& gt; article_active_name '=>' name_arbik ',' sub_category_name_english '= & gt; Name_english ')) - & gt; Where ('article. Active = 1');    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -