Hi all :-)

I'm trying to populate a drop down list using Model->find('list')
where the display field is a concatenation of two other fields in the
model.

I am using the following code:

$projectRelationshipTypes = $this->ProjectsProject-
>ProjectRelationshipType->find('list', array("fields"=>array("id",
"concat(name, ' / ', antonym) as name"), "order"=>"name"));

Which produces the following (correct) SQL:

SELECT `ProjectRelationshipType`.`id` , concat( name, ' / ', antonym )
AS name
FROM `project_relationship_types` AS `ProjectRelationshipType`
WHERE 1 =1
ORDER BY `name` ASC

This query is correctly returning the two rows I would expect with two
fields (id, name)

My problem is that the find() is returning an empty array and the drop
down list is blank :-(

What am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to