Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.