On Feb 12, 2008 12:48 PM, jvandal <[EMAIL PROTECTED]> wrote:

>
> HI,
> I am new to cakephp and I want to select a person (by name)in a table
> and link it to another table 'events'  that will list all events
> related to that person.
> I want to do it on the same page.
> I would like an example of the cakephp code. I can create the tables
> in scaffolding but only displays all people and then list all events,
> but I can't understand how to create the code to do what I want.
> Thanks for any help
> Jim

 - If your events table has field 'user_id' which belongs to 'id' field in
users table then in User model by adding code var $hasMany =>
array('Event');, the events will be fetched for a user if you do find or
findAll for user

-- 
Regards,
Amit

http://amitrb.wordpress.com/
http://coppermine-gallery.net/
http://cheesecake-photoblog.org/
http://www.sanisoft.com/blog/author/amitbadkas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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