Tuesday, September 30, 2008

Find - table join - find all posts by user_id using the name

Hi,

Im building a site where i would like to retrieve all articles based
on a username. The username is supplied as part of the url i.e.
mysite.com/userName.

So i need to use find to list all posts based on username however I
only have user_id in the posts table, which then joins to the user
table on id.

So im looking for an example of how to run a find command passing in
the username, and joining on the user_id to the user table.

Can anyone advise?

Best regards, Ben.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: