1

I'm creating a website where people can share and upload things, but I want to add a like/recommend button. I want to check that if the user has recommended something or not, so they can't spam click it. I had an idea of how to do it: I had a column called 'recby' for each post and I would store a list of users who had recommended that post separated by commas. Then I learned about normalisation.

How would I do this whilst sticking to normalisation?

4

1 回答 1

0

您添加一个为您存储喜欢的表格:

PostID | UserID
---------------
5      | 6
5      | 15
6      | 8

像这样的东西。现在,每个赞都有一个条目,同时保持一切正常化。

于 2013-11-08T07:54:33.520 回答