What're you trying to do? Your array dump looks like only contains ONE Holiday with MANY Products (which is TRUE, according to your definition earlier).
If you wanted to iterate through the products, you should use: Foreach($data['Product'] as $product) Not $data['Holiday']. -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of leamas Sent: 19 Desember 2006 3:55 To: Cake PHP Subject: Re: Joining 2 tables - better practice? I tried to follow the information from the link you provided, but it didn't work. Nor did trying $product['Holiday']['Product'] Here is basic output of my array ( I removed most of the output ): Array ( [Holiday] => Array ( [id] => 1 [holiday_name] => Halloween ) [Product] => Array ( [0] => Array ( [id] => 668 [product_name] => Cathy B Vellum Stickers - Crazy Candies [description] => This is a package of bright and festive Cathy B vellum stickers that are "raised and glitter-glazed." It includes approx. 20 various types of candy like lollipops, jellybeans, gum and more. [price] => 1.29 [URL] => http://www.scrapstop.com/shop.php?op=itemdetails&item=10612&refid=839176107 [image] => http://www.scrapstop.com/images/10612_sm.jpg [category_id] => 12 [holiday_id] => 1 [added] => 2006-04-29 [newProd] => 0 [stock] => 1 [hits] => 3 ) ... Now if I change foreach ($data as $product) to foreach($data['Holiday'] as $product) and this returns the error: Warning: Invalid argument supplied for foreach() Jon M. wrote: > I has the same question/problem the other day and nate came to the > rescue. > > --> > http://groups-beta.google.com/group/cake-php/browse_thread/thread/44f343a620 af343d > Hopefully that helps. > > Nate is the man! :) > > - J > > On Dec 17, 12:38 pm, "leamas" <[EMAIL PROTECTED]> wrote: --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
