CREATE TABLE userComments
(
  -- comments_id int unsigned NOT NULL DEFAULT 0 AUTO INCREMENT,
  commenter_id int unsigned not NULL default 0,
  commented_id int unsigned not null default 0,
  relationship tinyint unsigned not null default 0,
  comment       TEXT NOT NULL default '',
  PRIMARY KEY (commented_id,commenter_id), -- means a commenter can
leave only 1 comment commented user
  -- PRIMARY KEY (commented_id, commenter_id, comments_id) get a better
index scan if looking for all commentes if a commenter can leave
multiple comments
  -- INDEX comments_id (comments_id)
);
 

> -----Original Message-----
> From: Kentucky Families [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 19, 2005 6:13 AM
> To: mysql@lists.mysql.com
> Subject: Adding user commments to database records
> 
> I would like for logged-in site visitors to be able to submit 
> comments to be appended to my database records. I've seen 
> some databases that use a post-it-note style system. What 
> might be the best way to go about this.
>  
> The following conditions apply:
> Multiple users may post comments on the same record; User 
> will also choose a "relationship" to the subject of the record;
>  
> Screen output will be:
>  
> Record
> Comments/User/Relationship
> Comments/User/Relationship
>  
> etc.
>  
> Thanks.
> 
>               
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - Find what you need with new enhanced search. 
> Learn more.
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to