Put both conditions in the 'or' key:

$datetime =  date("Y-m-d H:i:s");
$count =$this->PromoCode-
>findCount(array("OR"=>array("PromoCode.start_date" =>"> $datetime",
'PromoCode.active'=>'<>1')));



On Nov 20, 11:49 am, zonium <[EMAIL PROTECTED]> wrote:
> I have these statements:
>
> $datetime =  date("Y-m-d H:i:s");
> $count =$this->PromoCode->findCount(array("PromoCode.start_date" =>">
> $datetime", "OR"=>array('PromoCode.active'=>'<>1')));
>
> With debug enabled I saw cake tried to create this query:
>
> SELECT COUNT(*) AS `count` FROM `promo_codes` AS `PromoCode` WHERE
> `PromoCode`.`start_date` > '2007-11-19 17:38:54' AND
> ((`PromoCode`.`active` <> 1))
>
> According to the official manual (http://manual.cakephp.org/chapter/
> models) I expected
>
> OR (`PromoCode`.`active` <> 1)
> instead of
> AND ((`PromoCode`.`active` <> 1))
>
> Is it a bug or my statement was not correctly written.
>
> Thanks,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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