Or even better this!!!

Example:

Array
(
    [Projectcategory] = Array
         (
           [id] => 2
           [title] => Residential
           [alias] => residential
           [imagepath] =>
           [weight] => 1
           [published] => 1
           [RANDOM IMAGE FROM PROJECTS BELONG TO THIS CATEGORY FOUND
IN PROJECTIMAGES TABLE WHICH BELONGS TO PROJECTS]
         )
}

Thanks!

On Nov 23, 5:49 pm, Sarpidon <[email protected]> wrote:
> Hi. I am not sure how to do the following  - what is the best
> practice.
>
> I have a Projectcategories table that has many Projects.
> A Project has many Projectimages. What I want to do is to get the
> Projectcategory and a random image for each Project from
> Projectimages.
>
> For example:
>
> Array
> (
>     [Projectcategory] => Array
>         (
>             [id] => 2
>             [title] => Residential
>             [alias] => residential
>             [imagepath] =>
>             [weight] => 1
>             [published] => 1
>         )
>
>     [Project] => Array
>         (
>             [0] => Array
>                 (
>                     [id] => 1
>                     [category_id] => 2
>                     [title] => Project title
>                     [weight] => 1
>                     [published] => 1
>                     [Projectimage] => Random image from Projectimages
> table
>                )
>           )
> )
>
> I hope I am making my self clear :)
>
> Any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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

Reply via email to