Wednesday, June 23, 2010

Re: Error I can't understand when trying to access specific field from array retrieved by query

Hi!

Try to debug the $query_result variable and tell us what it returns.
You can use the debug function:

debug($query_result); 

just put this in your controller... =]

2010/6/23 Rick Dane <r.dane1010@gmail.com>
I'm having some problems using the standard cakephp myql queries with
some of my fields and I don't have the time to troubleshoot this so
I'm just trying to use standard mysql queries, using cakephp's query
call...

I'm calling my query (which I already set) with a code like this:

$result11 = $this->Emailretriefe->query($query_return1) ;   (this is a
query call set to "limit 1")

I am then trying to retrieve a specific field via this:

$query_result = $result11 ['saved_email'] ;

Then I set this for my view and attempt to echo it but I get an error:
" Undefined index: saved_email"

I can't understand why this is happening because this is how you would
access a field result in regular PHP and the cakephp documentation
makes no mention otherwise as to how this would be accessed... I would
appreciate any info on what I'm doing wrong.. thanks


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



--
Flàvia Missi

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: