No, run your find() from Project, not User. So pass the user_id, not the username.
On Fri, Mar 20, 2009 at 11:10 AM, cpeele <[email protected]> wrote: > > Wow! Thank you so much!! It worked! > > One question though, I didn't do a search on Projects by user_id but I > did do one by username, why is that different? > > function view($username) > { > $projects = $this->Project->User->findByUsername > ($username); > $this->set('projects', $projects); > } > > > Thanks again!!! > > > On Mar 20, 9:55 am, scs <[email protected]> wrote: >> In your view try this: >> >> <?php foreach($projects['Project'] as $project): ?> >> <?php echo $project['name']; ?> >> <?php endforeach ?> >> >> The reason this is happen is because your pulling data from your user >> table but only calling for one user and looking for multi projects for >> that user. >> >> If you want just the projects name and info and not all the other >> information do a search on the projects table based on the user_id. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
