I have created a comment box successfully using PHP with MySQL. The comment table structure is:
CommentID PK AI
Name
Email
Comment
CommentDateTime
I didn't use an ID to identify the page that is being commented on because I'm using this in only one.
When a user is logged in, the input field for name and email will disappear and the user's name and email that is stored in a session variable will be used. All works fine, but I need to use the user picture that is saved in MySQL to display in the comment box.
Should I add a UserID in the comment table? What if the comment is from a non-user, then should I just add null or 0? I'm quite confused on how to work with comment box using user picture.