Wednesday, June 27, 2012

Re: how to get rid from id column when i use find('list')

thanx a lot..its working

On Wed, Jun 27, 2012 at 5:15 PM, Marcus James <marcomtl@gmail.com> wrote:
When you write $this->Model->find('list'), it gives you an array in return. If you want only 1 field value , then you should use $this->Model->field('filename',array('conition goes here'));

In your case it should be $var = $this->Login->field('Category',('Login.username'=>$dbuser['Login']['username']));

make sure to check the case of the field name i.e its Category or category in you database.

--
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

--
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: