Wednesday, September 1, 2010

Re: Trouble with find conditions

On Wed, Sep 1, 2010 at 5:51 PM, Michael Gaiser <mjgaiser@gmail.com> wrote:
> The structure is currently a int(11) which can also be NULL.
>
> The command I am using is this.
>
> $results = $this->paginate('Location', array('Location.confirmed_id' =>
> 'null');
>
>
> but that doesnt seem to want to return anything. I understand that it isnt
> actually a the string "null" but I am unsure how to get it to return all the
> records that have a null in the confirmed_id.

No, that is the string, 'null'. Don't put quotes around it. You want
to use the PHP keyword, not a string.

$results = $this->paginate('Location', array('Location.confirmed_id' => null);

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: