Hey, I have a page where users can vote up or down other user's comments (like digg and reddit...).
I want to keep track of the comments a user has voted on. The comments all have a unique id.
So for example, if you are user_id #100 and you vote up comments #: 12,2,1,14,27,23 I need to store this info in mysql.
Now which is better, a table with repeat entries:
user_id | comment_id
100 12
100 2
100 1
100 14
100 27
100 23
Or, to do this:
user_id | comment_id
100 12,2,1,14,27,23
With the second method, to see if the user has voted for a specific comment I explode it into an array and search through it.
Method 1 would take more space on the webserver, but method 2 would be more for the script to process.
Which is better?
Thanks