On Aug 3, 2006, at 10:25 AM, Golfer001 wrote: <snip> > The above doesn't seem to work, when I call Order->findAll(), I don't > see each customer_id and product_id being associated with their > respective names. Basically, I am trying to do this: SELECT > orders.id,customers.name,products.name FROM orders,customers,products > WHERE orders.product_id = products.id AND orders.customer_id = > customers.id; What did I miss here? Thanks.
If there are keys in the `orders` table, then it belongsTo rather than hasMany. Think of those foreign keys like little labels that mark it as belonging to something else in the database. The way you have it keyed, Order belongsTo Customer, Order belongsTo Product, and both Product and Customer hasMany Order. -- John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
