>
> Not sure exactly what you mean, but I think that generally you would use a
> third table for this.
>
> As an example, take the famous blog case.
>
> We have posts and comments. Post hasMany Comment and Comment belongsTo Post.
> But Post also has an author, as does Comment.
>
> So we create User, and make:
> User hasMany Post
> Post belongsTo User
> Comment belongsTo User
>
> User
>       id
> Post
>       id
>       user_id
> Comment
>       id
>       user_id
>       post_id
>
> --
> Regards,
> Ryan Ginstrom

According to  your example:

If Post have several flelds and more than one fields need the id of
User table.
        id
        user_id   (the first user's id)
                user_id   (another user's id)

how do it?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to