Hi Joshua,

The generated SQL looks wrong to me. It should be something like this
(see `User`.`id` = `Referrer`.`referrer_id`):

SELECT `User`.`id`, `User`.`created_by`, `Referrer`.`id`,
`Referrer`.`created_by` FROM `users` AS `User` LEFT JOIN `users` AS
`Referrer` ON (`User`.`id` = `Referrer`.`referrer_id`) WHERE 1 = 1
LIMIT 20

Check your association foreignKey to make sure you've specified it
correctly.

In your add and edit views, the select should be filled correctly as
long as you are passing $referrers to your view. Check the $referrers
array to see what data is in there.

Cheers,
Adam


On Mar 7, 8:52 am, jaypee <[EMAIL PROTECTED]> wrote:
> Gday Adam,
>
> Done that. Referrer|name just brings up the users name.. not the
> referrers name. It seems as if the only record it returns is the users
> except when i look at the sql dump it is SELECT `User`.`id`,
> `User`.`created_by`, etc, `Referrer`.`id`, `Referrer`.`created_by`,
> etc, FROM `users` AS `User` LEFT JOIN `users` AS `Referrer` ON
> (`User`.`id` = `Referrer`.`id`) WHERE 1 = 1 LIMIT 20
>
> The two things I can't do that I would like to is display the names of
> the 'referrers' in the select lists that is in the edit and add views,
> and output their names in the view and index views.
>
> From going through the controller, I need more code in the view and
> index functions. I have tried different variations of find() but I am
> stabbing in the dark. I have yet to find some documentation to make
> sense to me (im guessing this because the add and edit have $referrers
> = $this->User->Referrer->find('list'); in their functions).
>
> Also, in the add and edit views, I am trying to figure out to add to
> the existing helper code so that the output would allow me to <select
> id=<? $id ?>><? $name></select etc. Currently its "$form-
>
> >input('referrer_id');"
>
> Thanks in advance,
>
> Joshua.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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