Howdy. ^^

I'm a noob at this so, please bear with me.. ^_^


I have these following tables with their corresponding associations:

Users-
          id, username, password,username, email, website,
date_registered, name, role_id, last_name, first_name, about
       hasMany=Post,Comment

Posts-
      id,       author_id ,     date_posted ,   content ,       title,  
date_modified ,
published
      belongsTo=User=>
           foreignKey=>author_id

      hasMany=Comment


Comments-
     id ,       post_id ,       date ,  content ,approved ,     agent , user_id 
,
parent_id
     belongsTo=Post,
              'User'=>
                 foreignkey=>user_id






Now if, for example, a registered-user wants to reply to a COMMENT,
that is under a POST, (like in youtube, where when you click "Reply"
in the side of another COMMENt by another registered-user, your
comment will be indented, making the Comment where you've clicked
"Reply",, the parent of your comment right?)

is putting the "parent_id" inside the comments table good enough?,
I've been thinking about this for hours now, sorry for the noobness.
^_^

if it is good enough, how do I make a table associate with itself...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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