> [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Hi there. Here's my problem:if  two fields at a table belong 
> to another
> table,how do i design the two table's structure and name the relating
> fields?

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


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