How do I loop through this array:
<?php print_r($products)?>
produces:
Array (
[0] => Array (
[Product] => Array (
[id] => 2
[title] => Another Test Product
[description] => some more description and stuff yeah
yeah yay
[inventory] => 15
[price] => 3.49
[color_id] => 2 )
[Color] => Array (
[id] => 2
[name] => Lime
[hex] => 3beb63 ) )
[1] => Array (
[Product] => Array (
[id] => 5
[title] => Green Headband
[description] => this is a nice green headband
[inventory] => 3
[price] => 2.54
[color_id] => 2 )
[Color] => Array (
[id] => 2
[name] => Lime
[hex] => 3beb63 ) ) )
...or is there a better way to do this? I have two tables: colors and
products.
Color hasMany Product, Product belongsTo Color. I'm trying to return
all the products in a specific color category...and display the
color.name at the top of the page.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---