I'm trying to find the number of records returned based on a certain
column having the value 11 or 12. I think I'm writing this correctly,
but cake doesn't like the fact that I have an OR statement based on 1
column.
this statement:
$outstanding = $this->Movement-
>find('count',array('conditions'=>array('OR'=>array('Movement.status'=>11,'Movement.status'=>12)),'recursive'=>-1));
produces this query:
SELECT COUNT(*) AS `count` FROM `movements` AS `Movement` WHERE
((`Movement`.`status` = 12))
I've tried changing this up a bit and have 2 different columns:
$outstanding = $this->Movement-
>find('count',array('conditions'=>array('OR'=>array('Movement.type'=>11,'Movement.status'=>12)),'recursive'=>-1));
produces:
SELECT COUNT(*) AS `count` FROM `movements` AS `Movement` WHERE
((`Movement`.`type` = 11) OR (`Movement`.`status` = 12))
This leads me to believe I'm writing this correctly, cake just won't
do the OR statement on a single column.
Anyone have any ideas? Otherwise I'll just manually write the query,
but I wanted to do it properly.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---