Jump to content

Users + Comments


devknob

Recommended Posts

I have a table with all of my user/profile info in it, but I need to allow a comments box per user where anyone can come by and leave a blurb.

 

Should I just have a record of the username being commented on to identify which comments belong to which username in a query? Or is there a better way im overlooking...

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/57797-users-comments/
Share on other sites

You should use another table with

comment_id int not null primary key

user_id int not null,

comment text not null

 

This way user_id will be the id of the user for whom the comment is being posted and any number of users can post comments to this user. Also if you want to keep track of which users left comments then you will have to introduce another field with id's of the users posting comment. Hope this will help.

Link to comment
https://forums.phpfreaks.com/topic/57797-users-comments/#findComment-288169
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.