0

I want to implement a badge modification to my website, i figured that I would have one new column in my mysql database to store number variables in them, and then i can display badges based on what number is in the mysql column for each user, should i use the SET field type to accomplish this?

4

1 回答 1

0

我建议你创建两个表:

  1. badges,包含每个徽章的详细信息;
  2. userbadges,包含一对外键 - 用户的外键和该用户拥有的徽章的外键。

这具有SET使您能够在不更改架构的情况下添加/删除/更改徽章的优势,并且还可以以最少的重复从其他表中引用徽章。

于 2012-06-03T07:15:18.537 回答