http://www.dereuromark.de/2010/10/07/cakephp-beginner-tips/
"find conditions"


On 17 Nov., 21:12, "[email protected]" <[email protected]> wrote:
> Hi all,
>
> I need to filter the result based on a set of regular expressions. For
> example, I want to find a list of names that do not contain the word
> "various" and ".com". So I have:
>
> $this->find('all', array('conditions' => array('Artist.name NOT
> REGEXP' => "Various",
>                                                             'Artist.name NOT 
> REGEXP' => ".com")));
>
> However, CakePHP only sees the second NOT REGEXP for ".com" only. I
> guess Cake sees the first one as duplicate and discard it. The
> resulted query is:
>
> SELECT * FROM `artists` AS `Artist` WHERE `Artist`.`name` NOT REGEXP
> '.com'
>
> Is there any way to accomplish what I want to do to get:
>
> SELECT * FROM `artists` AS `Artist` WHERE `Artist`.`name` NOT REGEXP
> '.com'  AND `Artist`.`name` NOT REGEXP 'Various'
>
> Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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