php - Trying to use "not like" operator on CakePHP


I'm trying to use the "not like" operator in cakephp, if I use this:

$users = $this->find('all', array(
            'fields' => array(
                '', 'User.first_name', 
                'User.last_name', '', 
                'User.division', 'User.department',
            'recursive' => -1, 
            'order' => array('User.first_name ASC'), 
            'conditions' => array(
                '' => true,
                '' => $comp,
                '' => $country,
                'User.division' => $division,
                'User.department' => $dpto,
                'NOT' => array(
                    'User.function LIKE' => 'COORD%'                    

The code works, however, if I try to put two same fields instead of one with different values like this:

'NOT' => array(
                'User.function LIKE' => 'COORD%',
                'User.function LIKE' => 'MANAG%'

It doesn't work, what am I doing wrong?


I already fixed it that day like this:

'NOT' => array(
                'User.function LIKE' => 'COORD%','User.function LIKE "MANAG%"'

I hope this is useful for someone.




Try to use array

'NOT' => array(
    'User.function LIKE' => array(

People are also looking for solutions to the problem: javascript - Conflict with JQuery on Symfony 3 while submitting form


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.