why the extra array?
array('conditions' => array('NOT' => array('Person.id' => $scouts)))
Am Mittwoch, 24. Oktober 2012 22:56:13 UTC+2 schrieb Matt:
>
> If that was just a typo in your email, maybe this would work
>
> $this->set('people', $this->Scout->Person->find('
> list', array('conditions' => array('Person.id NOT' => array($scouts))))));
>
> Matt
>
>
> On Wednesday, October 24, 2012 3:54:46 PM UTC-5, Matt wrote:
>>
>> Shouldn't it be
>>
>> $scouts = array(1,2,3);
>>
>> Matt
>>
>> On Wednesday, October 24, 2012 12:44:28 PM UTC-5, Nicholas Flint wrote:
>>>
>>> I am using two tables with a one-to-one relationship.
>>>
>>> Tables:
>>> people (id,first_name,last_name)
>>> scouts(id,rank,den,person_id)
>>>
>>> When creating a new Scout the people.id is selected from a dropbox. I
>>> need this dropbox to only populate with people.id that are not already
>>> in a scout.person_id. I'm trying to use:
>>>
>>> $scouts = (1,2,3);
>>>
>>> $this->set('people', $this->Scout->Person->find('list',
>>> array('conditions' => array('NOT' => array('Person.id' =>
>>> array($scouts))))));
>>>
>>> The SQL that is generated by cake only checks the first element in the
>>> array:
>>> SELECT `Person`.`id` FROM `db`.`people` AS `Person` WHERE NOT
>>> (`Person`.`id` = ('1,2'))
>>>
>>> So my dropbox displays 2 and 3 when it should only be displaying 3.
>>>
>>> Thank you in advance for any help you can provide.
>>>
>>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en.