Quick update: the following also produces the above result
$crp = $this->Tree->find('list',array('fields'=>array('id','cultivar
AS name')));
but
$crp = $this->Tree-
>find('list',array('fields'=>array('id','cultivar')));
works fine. Again, I'm on 1.3 beta, maybe this has been resolved?
Thanks
On Mar 9, 12:40 pm, Eleazar <[email protected]> wrote:
> Hi, I have the following code:
>
> $crop =
> $this->Tree->find('list',array('fields'=>array('id','CONCAT(Tree.cultivar,\' -
>
> \' ,Tree.stage) AS name')));
> debug($crop);
>
> It produces the following SQL:
>
> SELECT `Tree`.`id`, CONCAT(Tree.cultivar,' - ' ,Tree.stage) AS name
> FROM `trees` AS `Tree` WHERE 1 = 1
>
> When I debug $crop I get this:
> Array
> (
> [1] =>
> )
>
> There is only one entry in the Tree table so the 1 is fine, but there
> is no data... when I run the query directly in phpmyadmin I get
> id name
> 1 apples - year1
>
> The fact that $crop has a key but no value seems to be a bug? I'm not
> sure how to report this if indeed it is. I'm using 1.3 beta.
>
> Any help or comments would be appreciated!
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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en