Wednesday, March 28, 2012

Re: Problems with Find ('all')

Thanks Marcus, I tried another way and its working now:

$dados = $this->Usuario->find('all',
array('conditions'=>array('or'=>array(
'nome_usuario LIKE'=>'%'.$this->data['valor'].'%',
'nascimento_usuario LIKE'=>'%'.$this->data['valor'],
'email_usuario'=>$this->data['valor'] ,
'relacionamento_usuario'=>$this->data['valor'],
'paixao_usuario'=>$this->data['valor'])),
'order'=>array('nome_usuario ASC'), 'limit'=>100));

Thanks for your help!!!

On 28 mar, 09:43, Marcus James <marco...@gmail.com> wrote:
> Hi,
>
> I think your condition clause is not properly written.
>
> Try this
>
> $dados = $this->Usuario->find('all', array('conditions'=>array(
>                                        'OR'=>array(array('nome_usuario
> LIKE'=>'%'.$this->data['valor'].'%',
> 'ocupacao_usuario'=>$this->data['valor']),array('religiao_usuario'=>$this-> data['valor']),array('email_usuario'=>$this->data['valor'])))));
>
> Enjoy,
>
> Marcus

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: