Friday, July 2, 2010

Re: echoing data after retrieving it via "find". cake doesn't echo the actual value, but rather "array"

thanks guys..i will give it a shot

On 1 Jul., 18:41, Renato de Freitas Freire <renat...@gmail.com> wrote:
> I dont know what version you are using...
> but in 1.2, i would do like this:
>
> $adressee = $this->User->find('first',array('conditions' =>
> array('User.email' =>$user,'fields' => array('username'))));
>
> try it...
>
> --
> Renato de Freitas Freire
> ren...@morfer.org
>
> On Thu, Jul 1, 2010 at 12:46 PM, Jeremy Burns | Class Outfit <
>
> jeremybu...@classoutfit.com> wrote:
> > The results of the find is an array, so Cake is doing what it's told. You
> > will need to do something like:
>
> > $this->set('username', $addressee['User']['username']);
>
> > That's a guess - to check it, do this just after your find:
>
> > die(debug($addressee));
>
> > That will print the array returned by the find to screen and you'll be able
> > to pick your way through to the right part.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
>
> >http://www.classoutfit.com
>
> > On 1 Jul 2010, at 16:42, Tomfox Wiranata wrote:
>
> > > hi everyone,
>
> > > i am about to implement a "forgot password" feature. for that the user
> > > has to enter his email adress and then receives his new password. in
> > > this email i want to start
>
> > > Hello <username>,
>
> > > you forgot.....bla bla
>
> > > but i am having problems to actually get the username out of my
> > > database. it always says "hello array"
>
> > > i am using the "find" function
>
> > > $adressee = $this->User->find(array('User.email' =>$user),
> > > array('username'), null, false);
>
> > > to set the placeholder in my email i do this:
>
> > > $this->set('username', $adressee)
> > > ...
> > > ...
> > > $this->Email->send();
>
> > > any idea how i get the actual value out of it?
>
> > > thanks so much
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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: