Hi!

Thanks for the help!

I got it resolved using If in MySQL query as condition

$condition = 'IF(((select count(*) from '.$Table.' where
language_code="'.$this->Session->read('Site.Language').'" and '.
$ReferKey.'='.$Model.'.'.$ReferKey.')>0), language_code="'.$this-
>Session->read('Site.Language').'", language_code=(select code from
languages where base=1))';

in

$countrytranslations=$this->User->UserAddress->Country-
>CountryTranslation->find('list',array('conditions'=>array
($condition),'fields'=>array
('CountryTranslation.country_iso2','CountryTranslation.name'),'group'=>array
('CountryTranslation.country_iso2'),'order'=>array
('CountryTranslation.name')));

Regards!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to