I'm creating a racing-simulation based team website where I would like to have the ability for people to register and leave comments across a wide variety of page types.
-- bio page (commenter can leave a note on the team members page)
-- News Article (leave a comment on the news article in question)
-- Vehicle setup (leave a comment under the setup and whether or not it helped, etc, etc.)
In my mind, I can see this happening two ways...I'm just not sure which way to go about it and am looking for a little creative direction:
1) Use a 'users' MySQL table, and create a 'comments' table for each type of comment I would like saved (bio comments, setup comments, etc) and when the user leaves a comment, it would just use predefined SQL queries to insert the data into the appropriate table.
2) Use a 'users' table, but have only a single 'comments' table to store ALL the comments, only using different field types to filter the comments to their appropriate place.
My problem with Option 2 is that I'm not sure how to make it so the PHP/SQL combination knows where the comments are being posted from, and how to pull them out appropriately in the end.
That way something like:
would pull the comments specific to them from a uniform comments table. Use hidden form values?
Or is Option 1 the best route so all the data can be hardcoded rather than based on possible hidden values?
Suggestions / Opinions will be very helpful. Thank you!